Php Date Math
The your date will be formatted in a unix timestamp.
Php date math. If omitted the current date and time will be used as in the examples above. Date atom atom example. The unix timestamp contains the number of seconds between the unix epoch january 1 1970 00 00 00 gmt and the time specified. Now you can use the php date function to spew out nice date formats.
These functions depend on the locale settings of your server. You can then use the date time functions to format the date and time in several ways. C the iso 8601 date e g. Fri 12 apr 2013 12 01 05 0200 u the seconds since the unix epoch january 1 1970 00 00 00 gmt and the following predefined constants can also be used available since php 5 1 0.
Dt format y m d h i s p php eol. The date time functions allow you to get the date and time from the server where your php script runs. 20010111002747 date stored on mysql table timestamp 14 979172867 value returned as your date in sql stmt unix timestamp if we use newdate date f js y g ia row your date. Dt format y m d h i s p php eol.
Sample using above sql. The php mktime function returns the unix timestamp for a date. Remember to take daylight saving time and leap years into consideration when working with these functions. The optional timestamp parameter in the date function specifies a timestamp.
2013 05 05t16 34 42 00 00 r the rfc 2822 formatted date e g.