Date Time formatting and comparison issues

Here’s the code snippet…

<?php $DateString = meta('dvdReleaseDate'); $TimeStamp = strtotime($DateString); ?>

If I echo the $DateString, I get 2011-03-21 just as expected

If I echo the $TimeStamp, I get nothing…

If I plug in the ‘2011-03-21’ in place of $DateString, I get the time stamp I want ???

Help Please!!

Are you echo’ing $TimeStamp after this statement?
[php]$TimeStamp = strtotime($DateString);[/php]

There is absolutely no difference in the result of this function whether you pass argument in a variable $DateString or as a constant string ‘2011-03-21’.

Sponsor our Newsletter | Privacy Policy | Terms of Service