Skip to main content

Command Palette

Search for a command to run...

Time zone changing of a Heroku App๐Ÿš€

Updated
โ€ข2 min read
Time zone changing of a Heroku App๐Ÿš€

Recently, I was doing an automation tool project and have to deploy it with cron jobs on Heroku to run this tool at a specified time on a daily basis. The time zone that I needed to run this tool was America/Los Angeles. But the tool was running on the default UTC time zone of Heroku. So, to run this tool at a specified time from America/Los Angeles time zone I needed to change the time zone on Heroku.

Luckily Heroku let's us change the timezone of our app simply by adding a new config var named as TZ. You can change it in 2 ways. The steps needed to change it are as follow:-

WAY-01 (From the Heroku CLI)

  1. Open the command shell.
  2. Log In to Heroku.
  3. Navigate to your app's directory.
  4. Now, set up your Time Zone variable as TZ
heroku config:add TZ="America/Los Angeles"

WAY-02 (From the Heroku dashboard)

  1. Login into the Heroku dashboard from a browser LOGIN.png

  2. Navigate to the app for changing the time zone. NAV.png

  3. Click over the Settings tab. 43.png

  4. Press the "Reveal Config Vars" button. 44.png

  5. Set the key to "TZ" and the value to your timezone (E.g.: America/Los Angeles). 45.png

  6. Press the Add button. 46.png

How do I know which is the correct TZ value?

Follow this link to see the complete list of time zones.

Thank you for reading! Do share your valuable feedback and suggestions!

More from this blog

Sampling method in PySpark

๐’๐ข๐ฆ๐ฉ๐ฅ๐ž ๐‘๐š๐ง๐๐จ๐ฆ ๐’๐š๐ฆ๐ฉ๐ฅ๐ข๐ง๐  ๐จ๐ซ ๐ฌ๐š๐ฆ๐ฉ๐ฅ๐ž():- โ˜‘๏ธ In Simple random sampling, we pick records randomly and every records has an equal chance to get picked. ๐Ÿ”ต Syntax:- sample(withReplacement, fraction, seed=None) โ˜‘๏ธ Arguments:- =====...

Sep 4, 20224 min read
Sampling method in PySpark

The use case of ๐ž๐ฑ๐ฉ๐ซ() in PySpark

โ˜‘๏ธ It is a SQL function in pyspark to ๐ž๐ฑ๐ž๐œ๐ฎ๐ญ๐ž ๐’๐๐‹-๐ฅ๐ข๐ค๐ž ๐ž๐ฑ๐ฉ๐ซ๐ž๐ฌ๐ฌ๐ข๐จ๐ง๐ฌ. ๐Ÿ”ต ๐’๐ฒ๐ง๐ญ๐š๐ฑ:- ๐ž๐ฑ๐ฉ๐ซ(๐ฌ๐ญ๐ซ) โ˜‘๏ธ It will take SQL expression as a ๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐š๐ซ๐ ๐ฎ๐ฆ๐ž๐ง๐ญ and performs the operations within the expression. โ˜‘๏ธ It...

Sep 4, 20223 min read
The use case of ๐ž๐ฑ๐ฉ๐ซ() in PySpark
T

TheKishanYadav

7 posts