Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Convert YYYY to YYYYMMDD

$
0
0

I thought this one would be easy, but it isn't!

 

I want to convert years only to YYYYMMDD format, e.g. 2010 becomes 20100101.

 

But

 

$date = date('Ymd', strtotime(2000));
 

throws up today's date, viz. 20130326.

 

Any suggestions?

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles