Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2023 03:52 AM
I am trying to get today's date in the local time zone:
from pyspark.sql.functions import *
date = to_date(from_utc_timestamp(current_timestamp(), 'Australia/Melbourne'))What I get using the above code is a column object.
How can I get its value in a variable? I tried ".first()" but it doesn't work on the column object.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2023 11:33 AM
Hi @Mohammad Saber , you can use pytz and datetime python package for your usecase,, attaching code snippet in below screen shot.
Hemant Soni