Jump to content

catsoup

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by catsoup

  1. Thanks for the replies, I would actually prefer it to return false for a string like "I " rather than a date. The code I have is checking for dates embeded in text, and they will always be at the start of a string. Unfortunately the date can be just about any format the users PC has it set to, so I cant look for specific formats. I realise that 100% accuracy is therfore not possible, but 99% will do I did consider it was considering it to be roman numerals, but 'IV', 'V' or 'II' does return false, so I gave up on that idea. For now, I will leave my code checking for 'I<space>' at the start of a string. Not pretty, but I dont have time right now to step through the PHP souce. Anyway, Thanks for the replies
  2. Hi All, What do you think this should give? : echo strtotime('I'); (Thats a capital 'i') On my PHP 5.2.6 and PHP 5.3.3 and system, it seems to give a time nine hours previously: $ cat test.php <?php date_default_timezone_set('UTC'); $s="I"; echo "strtotime('$s')=".strtotime($s)."\n"; echo "date(strtotime('$s'))=".date(DATE_RFC822,strtotime($s))."\n"; echo "now=".date(DATE_RFC822)."\n"; $ php test.php strtotime('I')=1377749122 date(strtotime('I'))=Thu, 29 Aug 13 04:05:22 +0000 now=Thu, 29 Aug 13 13:05:22 +0000 Anyone know what format of date/time a single capital 'I' is matching? Cheers!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.