|
||||||||||||||||||||||
Date and Time : Time and Mktimetime(PHP 3, PHP 4 )
time -- Return current UNIX timestamp Descriptionint time (void)Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).
mktime(PHP 3, PHP 4 )
mktime -- Get UNIX timestamp for a date Descriptionint mktime ( int hour, int minute, int second, int month, int day, int year [, int is_dst])Returns the Unix timestamp corresponding to the arguments given. This timestamp is a long integer containing the number of seconds between the Unix Epoch (January 1 1970) and the time specified. This 'time' can then be used in conjunction with the date() function to output a date string based on a give time.
Code Examplesmktime() is useful for doing date arithmetic and validation, as it will automatically calculate the correct value for out-of-range input. For example, each of the following lines produces the string "Jan-01-1998".
The last day of any given month can be expressed as the "0" day of the next month, not the -1 day. Both of the following examples will produce the string "The last day in Feb 2000 is: 29".
Author: Markavian « Prev page 'Date and Strftime' « » Next Page 'MySQL Data and Time' » |
tutorial Pages
|
|||||||||||||||||||||