0

This is what I'm using but it doesn't seem to work.

$offer_expire = strtotime($item->expiry_date);

expiry_date is coming from an xml file and it's in a regular date/time format. Shouldn't strtotime() convert it to unix so I can save it in my $offer_expire variable?

Oliver84
  • 307
  • 2
  • 14
  • 1
    Can you add an example for `$item->expiry_date`, please? – ByteHamster Apr 11 '15 at 16:50
  • `strtotime` expects first parameter to be a string, `$item->expiry_date` most likely is a **SimpleXMLElement** or even `NULL` . So you should provide the exact string value here instead. For the time conversion problem you ask about, there is no interest at all where the string comes from, but what the string *is*, what the result *is* and which result you've expected instead. – hakre Apr 11 '15 at 17:00

0 Answers0