if (mktime(0,0,0,substr($date1,5,2),substr($date1,8,2),substr($date1,0,4)) >
time() ) // if $date1 > server time
{
//do stuff
}
I have a few conversions that I use. Our server stores all dates in YYYYMMDD
(as int) format, so I've got a few handy functions (OsDateToTimestamp(OsDate)
and TimestampToOsDate(Timestamp)) that seem to get called a LOT.
Thank you,
Jarrett Meyer
http://jarrettmeyer.blogspot.com
No trees were harmed during this transmission; however, several electrons were
terribly inconvenienced.
----- Original Message ----
From: Gustav Wiberg <[EMAIL PROTECTED]>
To: "'php windows' ([email protected])" <[email protected]>
Sent: Tuesday, April 24, 2007 5:38:00 AM
Subject: [PHP-WIN] $date1 larger then current date?
Hi guys!
I'm searching for what I thought would be an easy issue comparing dates. I just
want to know if a date in variable
$date1 is larger then current date.
I use the format YYYY-MM-DD in $date1
and I know how to retrieve the current date and set it in $dat2
But how do I know if $date1> $date2 ?
I have looked around, but I havent found any easy solution. It seems to be a
big deal? Is that the case?
Best regards
/Gustav Wiberg
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php