<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get today's date in the local time zone? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-get-today-s-date-in-the-local-time-zone/m-p/7082#M3058</link>
    <description>&lt;P&gt;Hi @Mohammad Saber​&amp;nbsp;, you can use pytz and datetime python package for your usecase,, attaching code snippet in below screen shot.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screenshot 2023-03-27 000020"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/478i2CC4EAB98C57B306/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-03-27 000020" alt="Screenshot 2023-03-27 000020" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Mar 2023 18:33:07 GMT</pubDate>
    <dc:creator>Hemant</dc:creator>
    <dc:date>2023-03-26T18:33:07Z</dc:date>
    <item>
      <title>How to get today's date in the local time zone?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-today-s-date-in-the-local-time-zone/m-p/7081#M3057</link>
      <description>&lt;P&gt;I am trying to get today's date in the local time zone:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from pyspark.sql.functions import * 
date = to_date(from_utc_timestamp(current_timestamp(), 'Australia/Melbourne'))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I get using the above code is a column object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get its value in a variable? I tried ".first()" but it doesn't work on the column object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/489i373B638738CBA44E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 10:52:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-today-s-date-in-the-local-time-zone/m-p/7081#M3057</guid>
      <dc:creator>Mado</dc:creator>
      <dc:date>2023-03-26T10:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get today's date in the local time zone?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-today-s-date-in-the-local-time-zone/m-p/7082#M3058</link>
      <description>&lt;P&gt;Hi @Mohammad Saber​&amp;nbsp;, you can use pytz and datetime python package for your usecase,, attaching code snippet in below screen shot.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screenshot 2023-03-27 000020"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/478i2CC4EAB98C57B306/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-03-27 000020" alt="Screenshot 2023-03-27 000020" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 18:33:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-today-s-date-in-the-local-time-zone/m-p/7082#M3058</guid>
      <dc:creator>Hemant</dc:creator>
      <dc:date>2023-03-26T18:33:07Z</dc:date>
    </item>
  </channel>
</rss>

