MirageLab :: Date/Time Formats and UNIX Timestamps

FAQs

mySQL
Browse in : All > FAQs > mySQL
Date/Time Formats and UNIX Timestamps


Due to the different time and date formats used in PHP and mySQL, the following clarifications are helpful:
  • NOW() returns date formated like 'YYYY-MM-DD HH:MM:SS' or 19971215235026 depending on whether it is interpretted as string or numeric format.
  • UNIX_TIMESTAMP() will accept, as argument, a DATE string, a DATETIME string, a TIMESTAMP, or a number in the format YYMMDD or YYYYMMDD in local time.
  • FROM_UNIXTIME() returns the UNIX format timestamp argument as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format.

  • < prev     next >

    Options:
    View Article Map