Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

ScenEdit_CurrentTime doesn't match Zulu time?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> ScenEdit_CurrentTime doesn't match Zulu time? Page: [1]
Login
Message << Older Topic   Newer Topic >>
ScenEdit_CurrentTime doesn't match Zulu time? - 6/23/2018 6:08:15 AM   
Whicker

 

Posts: 664
Joined: 6/20/2018
Status: offline
local TimeVar = ScenEdit_CurrentTime();
print (os.date("%A %B %d %H%M ",TimeVar)); -- same result if I do just %c

When I do this in the console it is returning a different time - the game is telling me it is 2159 Z or 1659 local, but the script returns 1459. the date is correct, just the hour doesn't match anything.

I tried this in a couple tutorials and got more or less the same thing - the script doesn't match the zulu time.

Why is this? the docs say "The UTC Unix timestamp of the current time in-game."

Also, what I would prefer is the time relative to a timezone, but I can't figure that out other than adding seconds to the raw epoch number to change the hours to what I want it to be - is there an easier way? that actually seems pretty easy though.
Post #: 1
RE: ScenEdit_CurrentTime doesn't match Zulu time? - 6/23/2018 6:46:11 AM   
Whicker

 

Posts: 664
Joined: 6/20/2018
Status: offline
Interesting - it was always off in the console, but I stuck it in the game and it is giving me local time to florida which is where the map is zoomed in to - and what I wanted.

it is not giving me UTC/Zulu.

(in reply to Whicker)
Post #: 2
RE: ScenEdit_CurrentTime doesn't match Zulu time? - 6/23/2018 7:08:34 AM   
Rory Noonan

 

Posts: 2816
Joined: 12/18/2014
From: Brooklyn, NY
Status: offline
Try this:
quote:


local TimeVar = ScenEdit_CurrentTime()
print (os.date("!%A %B %d %H%M ",TimeVar))


Also the semicolons are not necessary


< Message edited by apache85 -- 6/23/2018 7:13:16 AM >


_____________________________


(in reply to Whicker)
Post #: 3
RE: ScenEdit_CurrentTime doesn't match Zulu time? - 6/23/2018 7:22:55 AM   
Whicker

 

Posts: 664
Joined: 6/20/2018
Status: offline
Ah - I saw the ! in another post saying it was for UTC, but forgot and was looking for at the docs where it isn't mentioned.

Turned out my second post above was incorrect, I had an orphan variable that was screwing it up - so it was still off by 2 hours. I am adding 7200 on to the epoch time and it is returning what I want now.

(in reply to Rory Noonan)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> ScenEdit_CurrentTime doesn't match Zulu time? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.270