1 balupton Jul 05, 2006 05:39
3 balupton Jul 05, 2006 22:07
yes, but when i do that with say "Jul 5, 2006, 03:32", it returns -1....
4 blueyed Jul 05, 2006 23:26
Not here:
$ php -r 'echo strtotime("Jul 5, 2006, 03:32")."\n";'
1152063120
$ php -v
PHP 5.1.1 (cli) (built: Dec 30 2005 04:23:12)
Anyway, if you know the schema, use preg_replace and reformat it to a format that it recognizes.
5 balupton Jul 05, 2006 23:31
my local and remote server are both php 4.4.2.... if that changes something, but yeh, preg_replace should work.
In the end i didn't actually need to do this, but its worth knowing for the future.
Convert them to a unix timestamp and then compare them.
See www.php.net/strtotime and for JS: Date.getTime()