Skip to content

Instantly share code, notes, and snippets.

@egulhan
Created October 21, 2013 11:40
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 egulhan/7082472 to your computer and use it in GitHub Desktop.
Save egulhan/7082472 to your computer and use it in GitHub Desktop.
Convert a date arguments into variables by preg_split.
date_default_timezone_set('Europe/Istanbul');
$date=date('Y-m-d h:i:s');
list($year,$month,$day,$hour,$minute,$second)=preg_split('/[- :]/',$date);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment