Skip to content

Instantly share code, notes, and snippets.

@hanssens
Created December 20, 2011 13:57
Show Gist options
  • Save hanssens/1501644 to your computer and use it in GitHub Desktop.
Save hanssens/1501644 to your computer and use it in GitHub Desktop.
[PHP] Set DateTime by Locale
// Sometimes the UTF-8 suffix is required (sigh)
setlocale(LC_ALL, 'nl_NL.UTF-8');
/* Expected Output: vrijdag 22 december 1978 */
echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment