Blijbol, happy business   Dutch English

Links About Blijbol Guestbook
Home News Games Software Game Maker
Downloaded 801 times

PHP date() for GM

Converts dates to strings


Game Maker contains the functions date_datetime_string(), date_date_string() and date_time_string(), but it does not have a function to convert a date-time value to a custom format. That's where this script comes in, which uses the same format as the PHP function date(). Except for the timezone related characters and the full date/time characters, everything is supported. Because of known precision problems in Game Maker 6, the date and time must be passed as separate date-time values. (the time is optional)

Version 1.1 (stable)

Release date: 25 July 2006
Language: Dutch
System requirements: Game Maker 5.3a or later (also works in Lite/unregistered edition)

Project status

A stable version of this product has been released. The project was announced at 4 March 2006.


This script has been created by Jeroen van der Gun. It is highly appreciated to mention this in the credits of your game.

More for Game Maker


No comments have been posted yet. Use the form to post one.




Returns the notation of the as date-time values provided date (and time), following the specified format. You can create the format using the characters from the documentation below.

Supported formatting characters


\ Escaper, show next character litterally


d Day of the month, with zerofill (01-31)
D Day of the week, textual and abbreviated (Mon-Sun)
j Day of the month, without zerofill (1-31)
l (small L) Day of the week, textual and long (Monday-Sunday)
N Day of the week, numeric starting with Monday (Mon=1, Sun=7)
S Postfix for ordinal number of day of the month (st, nd, rd, th)
w Day of the week, numeric starting with Sunday (Sun=0, Sat=6)
z Day of the year, 1 January is zero (0-365)


W Week of the year, starting with Monday (1-52)


F Month, textual and long (January-December)
m Month, numeric with zerofill (01-12)
M Month, textual and abbreviated (Jan-Dec)
n Month, numeric without zerofill (1-12)
t Number of days in month (28-31)


L Leep year, boolean (0=no, 1=yes)
o Year according to week number, long (bijv. 2006)
Y Year according to date, long (bijv. 2006)
y Year according to date, abbreviated (bijv. 06)


a Ante Meridiem or Post Meridiem, lowercase (am, pm)
A Ante Meridiem or Post Meridiem, uppercase (AM, PM)
g Hour, 12-hours without zerofill (1-12)
G Hour, 24-hours without zerofill (0-23)
h Hour, 12-hours with zerofill (01-12)
H Hour, 24-hours with zerofill (00-23)


i Minute, with zerofill (00-59)


s Second, with zerofill (00-59)

Add a comment

1 × 4 =
Blijbol =