I have a variable created from data taken out of a mySQL database the variable is a date value in the format YYYY/MM/DD i need to beable to format this date and also retrieve a unix timestamp from it, ive looked all through the PHP documentation and couldnt find anything to allow me to format a variable, maybe i missed something, can someone point me in the right direction
Chris
PHP Date Format
Moderator: General Moderators
Date Format...
To format a Unix Time stamp use strftime() function.
To format a GMT time value, use gmdate().
To format a GMT time value, use gmdate().
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you're storing the date in a date or timestamp field in MySQL (which makes life a lot easier) you can easily format it using MySQL when you retrieve it:
http://www.mysql.com/doc/en/Date_and_ti ... tions.html
Mac
http://www.mysql.com/doc/en/Date_and_ti ... tions.html
Mac