MaddDogg Posted May 13, 2010 Share Posted May 13, 2010 Hi! I just ran into the problem of not having a source for the epoch time. So I decided to try my best and script my own function. I'm as far as the following: function getEpochTime() local nowTime = getRealTime() return ((1900 + nowTime.year) - 1970) * 365.25 * 24 * 60 * 60 + nowTime.month * 30.4167 * 24 * 60 * 60 + nowTime.monthday * 24 * 60 * 60 + nowTime.hour * 60 * 60 + nowTime.minute * 60 + nowTime.second end But still, there is something incorrect. I think it has something to do with the leapyear, but I can't figure it out. It would be cool if you could help me or even give me a finished function, if there is one. Thanks in advance! Madd Link to comment
robhol Posted May 13, 2010 Share Posted May 13, 2010 This? Or did I misunderstand something? Link to comment
MaddDogg Posted May 13, 2010 Author Share Posted May 13, 2010 Thanks! That's the function I searched the whole day for, but couldn't find it! Thank you again! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now