Re: [PHP] Adding zeros to date

2001-10-05 Thread Dimitris Kossikidis
This should be fine... $month = 5; $year = 2001; $day = 6; echo date( "Y/m/d", mktime( 0, 0, 0, $month, $day, $year ) ); Output "2001/05/06" - Original Message - From: "Daniel Alsén" <[EMAIL PROTECTED]> To: "php" <[EMAIL PROTECTED]> Sent: Friday, October 05, 2001 12:44 PM Subject: [PHP

Re: [PHP] Adding zeros to date

2001-10-05 Thread Negrea Mihai
if you can't do it with date() use substr("0".$month, -2, 2) On Friday 05 October 2001 09:44, Daniel Alsén wrote: > Hi, > > is there a easier way to add zeros to date than the script below? (ie to > get 20011005 instead of 2001105). I wrote a long string replace. But it > seems kind of unecessary