SinMaster1996 granted Moderation Status at 3.79079e+009
How do I make that number into a real time?
text2file("[usr.key] granted [A.key] Moderation Status at [world.realtime]","Admin.txt")
ID:154732
Jan 5 2012, 12:45 am
|
|
How do I make it so the hosts time is shown? I have tried the Real time and time vars but they come out to be a mess. Like so;
SinMaster1996 granted Moderation Status at 3.79079e+009 How do I make that number into a real time? text2file("[usr.key] granted [A.key] Moderation Status at [world.realtime]","Admin.txt") |
time2text proc
text2file("[usr.key] granted [A.key] Moderation Status at [time2text(world.realtime)]","Admin.txt") But timeofday is more accurate than realtime. |
You also want to convert that into a nicer format. I believe world.realtime doesn't provide a very clear result.
You may want to do formatting AM / PM. I would check, but the reference seems to be down right now. |
time2text() has arguments that can be used to format the result.
From F1: "The default format is "DDD MMM DD hh:mm:ss YYYY", which produces results such as "Wed, May 23 15:41:13 2001". As you can see, the fields in the format text are replaced by components of the date and time. The following list contains all of the recognized fields. Anything else in the format string is inserted directly into the output. YYYY year (2001, 2002, ...) YY year (01, 02, ...) Month January, February, ... MMM Jan, Feb, ... MM number of the month (01, 02, ...) Day Monday, Tuesday, ... DDD Mon, Tue, ... DD day of the month hh hour (00, 01, ... 23) mm minute ss second Because world.timeofday is in a range of 0 to 864000, values in this range are treated as a time for the current date. This way time2text() can return accurate results for world.timeofday. Any other values are interpreted as coming from world.realtime and will have the right time and date." |
This is based on the server time though is it not?
Perhaps instead you should use offsets from the client to figure out the time on the client's machine. Due to Timezones and such. |
Regardless!
There's a proc built into BYOND, time2text(), which will take world.timeofday or world.realtime and turn it into a more friendly string for you to use.