Skip to content

Instantly share code, notes, and snippets.

@roborourke
Created April 9, 2015 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roborourke/0d4fbced7c500fe37d6f to your computer and use it in GitHub Desktop.
Save roborourke/0d4fbced7c500fe37d6f to your computer and use it in GitHub Desktop.
strptime issue 5.5 problem
<?php
setlocale( LC_TIME, 'fr_FR' );
$date = strptime( '03 juin 2015 00:00:00', '%d %B %Y %H:%M:%S' );
$time = mktime( 0, 0, 0, $date['tm_mon'] + 1, $date['tm_mday'], $date['tm_year'] + 1900 );
var_dump( $date, $time, date( 'Y-m-d H:i:s', $time ) );
// on 5.5 returns false, 0, 1970-etc...
// on 5.6 returns array(), NNNNNNNNNN, 2015-06-03 00:00:00
// halps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment