Skip to content

Instantly share code, notes, and snippets.

@ashokrane
Created February 23, 2019 12:45
Show Gist options
  • Save ashokrane/cee50978ef8624c229fff97737153618 to your computer and use it in GitHub Desktop.
Save ashokrane/cee50978ef8624c229fff97737153618 to your computer and use it in GitHub Desktop.
strtotime() returning blank or empty timestamp
<?php
echo strtotime( '21-02-2019 10:0' ); // 1550743200
echo '<br>' . strtotime( '21-02-2019 10:00' ); // 1550743200
echo '<br>' . strtotime( '21-02-2019 100' ); // blank, thereby results in a date of 1-1-1970 when used in date()
echo '<br>' . strtotime( '21-02-2019 1000' ); // 1550743200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment