Cron job time-zone change

software development


I’ve got a cron job running to fetch a jpeg at a static URL so I can build time-lapse videos. Everything is going fine except that the time/date stamp are all Pacific Time since that’s where DreamHost is. I’d like to have the time stamp with the offset to Hawaii Standard Time (we never go into DST). We’re -10 offset UTC if that’s any help as it’s probably better to base upon that rather than PST due to DST?

Here’s an example of the code I currently have that gets the remote jpeg, changes the filename to embed custom name, date and time.

cd wget -O staticimage-`date +%Y-%m-%d-%H%M%S`.jpeg



export TZ='Pacific/Honolulu' cd wget -O staticimage-`date +%Y-%m-%d-%H%M%S`.jpeg


Excellent! That seems to have done the trick. Mahalo