Assume a program running in (British Standard Time)BST generates a date time value for current time in UTC (YYYY-MM-DDTHH:MM:SS.SSSZ) format. Also assume current time in London is 2016-06-01 12:33:54.
The timestamp returned by time.time() is not in any timezone. "seconds since the epoch" is a term; it is not elapsed seconds since some point in time (epoch). You can convert it to your local time (with tz database) and/or UTC timezone easily. btw, if you drop .strftime() the result is (almost) the same (+/- microseconds).
UTC & GMT are time-keeping, not formats UTC and GMT are not formats. UTC and GMT are two slightly different ways of tracking time. This is a complicated topic, so see the Wikipedia pages for the gory details if you really want to know. For common business apps, there is no significant difference, literally less than a second’s difference.
The value returned from getTimezoneOffset() is the value you need to add to a local time to get to UTC. So if you have want to go from UTC to local time, the action needs to be -.
Learn how to convert UTC date time to local date time with examples and solutions provided by the Stack Overflow community.
95 Can MySQL convert a stored UTC time to local time-zoned time directly in a normal select statement? Let's say you have some data with a timestamp (UTC).
This is an old question that came up in my feed today, and it's full of misinformation. Timestamp is always in UTC. new Date().toString() will show you current time zone time representation, new Date().toUTCString() will show you UTC time repr, but new Date().getTime() is always UTC, because that is what Unix time is defined as: "Unix time (also known as POSIX time or epoch time) is a system ...