How do you account for months when converting to epoch time?
Shenanigans Studio
Member, PRO Posts: 73
I would assume the formula for converting to epoch time would be:
(game.year-2016)(Seconds in a year)+(game.month-1)(HOW MANY SECONDS IN A MONTH???)+(game.day-1)(Seconds in a day)+(game.hour)(seconds in a hour)+(game.minutes)*(60)+game.seconds.
The problem being I have no idea how many seconds are in a month because it varies from month to month..
Comments
This site has a specific value for the number of seconds in a month: http://www.epochconverter.com. You might just use that...?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
but that number is an average. It would mess up my time right? like February 1st it would count january as 30.5 days(the average) but really its 31 days so half a day would be shaved off my epoch time.
I suppose that's true. I'm sure someone else has had to tackle this question so hopefully you get some advice here!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yeah I sure hope so, but I appreciate the effort pal!
Here is a thread from about 6 months ago that might be of interest.
http://forums.gamesalad.com/discussion/comment/542008/#Comment_542008
The last posting of the thread indicates that @Armelline may have found a solution. His signature also has a link to a 'resource gathering template with inactive time counter'. That may be what you are looking for.
Edit ---
I just remembered this posting:
http://forums.gamesalad.com/discussion/comment/414285/#Comment_414285
Three may be some useful bits in download file for you.