Created
July 24, 2014 01:14
-
-
Save operator-DD3/813765f564fb3ff614c3 to your computer and use it in GitHub Desktop.
Lua Date Problem. These values, I thought, should be equal. 'a' is 6 hours behind 'b'.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local a = os.date('%c') | |
local b = os.date('!%a %b %d %H:%M:%S %Y') | |
print('Date: ' .. a) | |
print('UTC: ' .. b) |
I still don't understand.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can anybody tell me what's going on here? Why don't the 2 strings match? How can I make them match? Do I subtract the 6 hours for my timezone and update the date? That seems a little hackish.
When I use os.date('%!c') the ! tells it to format date in UTC, which it does, but returns time and date from the Zero time zone.