May 2003
Intermediate to advanced
592 pages
14h 28m
English
Last but certainly not least, I’ll introduce a couple of PHP’s date- and time-related functions. The most important of these is the aptly named date() function, which returns a string of text for a certain date and time according to a format you specify.
date (format, [timestamp]);
The timestamp is an optional argument representing the number of seconds since the Unix Epoch (midnight on January 1, 1970) for the date in question. If not specified, PHP will just use the current time on the server.
There are myriad formatting parameters available (Table 3.1) and these can be used in conjunction with straight text. For example,
echo date('F j, Y'); // January 21, 2003 echo date('H:i'); // 23:14 echo date('D'); // Mon ...Read now
Unlock full access