date("Y-m-d");

Niklas

-----Original Message-----
From: Andy [mailto:[EMAIL PROTECTED]] 
Sent: 5. maaliskuuta 2002 9:59
To: [EMAIL PROTECTED]
Subject: [PHP] How to get the local date formated like this: 2002-03-15
Y2K Problem


Hi there,

I am trying to find out how to get the local date in a format conform to
this: 2002-03-15.

The following code is a try, but it does not work like I want:

$local_time = localtime(time() , 1);
echo "Date: " .
$local_time[tm_year].'-'.$local_time[tm_mon].'-'.$local_time[tm_mday];

Returns: Date: 102-2-5
The prob is, that tm_year is not y2k compliant and the 0 are missing for
month and day

The goal is to find out, if a date provided by the user is in the future
or not. His date is in this format: [yyyy-mm-dd]

Has anybody an idea?

Thanx,

Andy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to