The email event returns a timestamp that looks like this:
1214092041
Does anyone know off the top of his/her head where there is a function to return in a normal format? (e.g. date / time -- don't care if time is 24 hour or American format.)
These forums are CLOSED. Please visit the new forums HERE
Email Timestamp to human time |
|
|
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
|
06-21-2008 16:57
The email event returns a timestamp that looks like this:
1214092041 Does anyone know off the top of his/her head where there is a function to return in a normal format? (e.g. date / time -- don't care if time is 24 hour or American format.) _____________________
Thread attempting to compile a list of which animations are freebies, and which are not:
http://forums.secondlife.com/showthread.php?t=265609 |
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
06-21-2008 22:52
time is a UNIX timestamp (integer) typecast as a string, similar to that returned by llGetUNIXTime. You could use an external utility to convert to a human-readable date/time, or calculate the date in LSL (I believe UNIX time ignores leap seconds, so that means you only have to deal with leap years and the normal calendar). That or you could compare the results of llGetUNIXTime() and a more readable function like llGetDate() or llGetTimestamp() and use that to do a conversion. http://www.lslwiki.net/lslwiki/wakka.php?wakka=email http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetUNIXTime http://www.lslwiki.net/lslwiki/wakka.php?wakka=time |
|
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
|
06-23-2008 18:30
>> You could use an external utility
wanted to do it in an LSL script. Recording the time from an email event paramater was just a "nice to have", so it seemed easier to just get it and record it myself in a normal format in the email body, so I have done that. You could use an external utility to convert to a human-readable date/time, or calculate the date in LSL (I believe UNIX time ignores leap seconds, so that means you only have to deal with leap years and the normal calendar). That or you could compare the results of llGetUNIXTime() and a more readable function like llGetDate() or llGetTimestamp() and use that to do a conversion. http://www.lslwiki.net/lslwiki/wakka.php?wakka=email http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetUNIXTime http://www.lslwiki.net/lslwiki/wakka.php?wakka=time _____________________
Thread attempting to compile a list of which animations are freebies, and which are not:
http://forums.secondlife.com/showthread.php?t=265609 |
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
06-23-2008 18:36
wanted to do it in an LSL script. It might be JIRA time then. The localtime/gmtime stuff would be kind of hairy to do in LSL, looping through to find all the leap years and all that fun. _____________________
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
06-24-2008 11:39
It's not THAT bad. I believe this should do it.
CODE
|
|
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
|
06-24-2008 12:10
It's not THAT bad. I believe this should do it. list MONTHS = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]; ah cheers, I'll give it a go and see if I have enough memory for it. Thank you very much. _____________________
Thread attempting to compile a list of which animations are freebies, and which are not:
http://forums.secondlife.com/showthread.php?t=265609 |