Recent Topics

1 Jul 05, 2006 05:39    

I need a way to compare two dates, one of the dates is in the format "Jul 5, 2006, 03:32" => "'M j, Y, H:i'".

The other one is a javascript date of the current time.

By compare i mean, find out if one is after or before the other.

Cheers.

3 Jul 05, 2006 22:07

yes, but when i do that with say "Jul 5, 2006, 03:32", it returns -1....

4 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 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.


Form is loading...