localtime

Get the Olson TZ name for the local timezone?

Get the Olson TZ name for the local timezone? Question: How do I get the Olson timezone name (such as Australia/Sydney) corresponding to the value given by C’s localtime call? This is the value overridden via TZ, by symlinking /etc/localtime, or setting a TIMEZONE variable in time-related system configuration files. Asked By: Matt Joiner || …

Total answers: 11

Convert UTC datetime string to local datetime

Convert UTC datetime string to local datetime Question: I’ve never had to convert time to and from UTC. Recently had a request to have my app be timezone aware, and I’ve been running myself in circles. Lots of information on converting local time to UTC, which I found fairly elementary (maybe I’m doing that wrong …

Total answers: 16

How to convert local time string to UTC?

How to convert local time string to UTC? Question: How do I convert a datetime string in local time to a string in UTC time? I’m sure I’ve done this before, but can’t find it and SO will hopefully help me (and others) do that in future. Clarification: For example, if I have 2008-09-17 14:02:00 …

Total answers: 25