SA-MP Forums Archive
Date formatting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Date formatting (/showthread.php?tid=82817)



Date formatting - michael2572 - 21.06.2009

Anyone know of a way to format a timestamp into readable format? Like January 1, 2008.


Re: Date formatting - woot - 21.06.2009

http://pawno.pastebin.com/m3b2dd07d

Untested


Re: Date formatting - michael2572 - 25.06.2009

That's a good start but it uses the current time, so it knows the day and month and all. I'm looking for something that can be handed a timestamp, like PHP's date(). Also that code snippet would be more efficient with an array of month names rather than a control structure.


Re: Date formatting - Harry_Gaill - 25.06.2009

http://pastebin.com/f27b8bbb2

More or less the same.

You can't get too far with it though. I believe you are expecting something like this "Thursday 25th of June 2009 05:08:55 AM", but no not really possible.