RE: [PHP-DB] CONVERT STRING VARIABLES TO DATES, THEN COMPARE (HOW?)

From: Date: Fri, 07 Nov 2003 19:01:28 +0000
Subject: RE: [PHP-DB] CONVERT STRING VARIABLES TO DATES, THEN COMPARE (HOW?)
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31491@lists.php.net to get a copy of this message
Strtotime() Look it up in the manual :-) -----Original Message----- From: Karen Resplendo [mailto:karenresplendo@yahoo.com] Sent: den 7 november 2003 19:44 To: php-db@lists.php.net Subject: [PHP-DB] CONVERT STRING VARIABLES TO DATES, THEN COMPARE (HOW?) Apache on NT using MS SQL Srvr 2000 PHP 4.03pl1 I return these dates into strings and now I want to compare my database date to see if it is later than today's date. Pretty sure my "Expires" field is a string: Here is the "Expires" field from the SQL: Convert(varchar, DATEADD(Year,3,DateCertified),101) AS Expires Here is my PHP code trying to compare dates: $today = date("m/d/Y"); If ($today < odbc_result($data,"Expires")) { echo "<br><br>License has expired<br><br>"; } Else { echo "<br><br>License has not expired<br><br>"; } Sure could use a simple solution to a simple problem that has me simply confounded. --------------------------------- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard

« previous php.db (#31491) next »