>
Sent: Friday, October 05, 2001 12:44 PM
Subject: [PHP] Adding zeros to date
> 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 to me. Is it?
>
>
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
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 to me. Is it?
$date_time_array = getdate (time());
$date = $date_time_array[ "mday"];
$month = $date_time_array[ "mon"];
3 matches
Mail list logo