• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. PHP > Date/Time Functions

16.16. Date/Time Functions

PHP provides the following functions for working with dates and times:


bool checkdate(int month, int day, int year)

Validate a date/time


string date(string format[, int timestamp])

Format a local date/time


array getdate([int timestamp])

Get date/time information


array gettimeofday(void)

Return the current time as array


string gmdate(string format[, int timestamp])

Format a GMT/CUT date/time


int gmmktime(int hour, int min, int sec, int mon, int mday, int year)

Get Unix timestamp for a GMT date


string microtime(void)

Return a string containing the current time in seconds and microseconds


int mktime(int hour, int min, int sec, int mon, int mday, int year)

Get Unix timestamp for a date


void sleep(int seconds)

Delay for a given number of seconds


string strftime(string format[, int timestamp])

Format a local time/date according to locale settings


int time(void)

Return current Unix timestamp


void usleep(int micro_seconds)

Delay for a given number of microseconds


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint