Skip to content

Instantly share code, notes, and snippets.

@piccaso
Created May 5, 2012 16:37
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 piccaso/2603879 to your computer and use it in GitHub Desktop.
Save piccaso/2603879 to your computer and use it in GitHub Desktop.
parsing dd.mm.yyyy hh:ss (tt.mm.jjjj ss:mm) date (used in austria)
<?php
function parse_austrian_date($date,$output='U'){
$date = DateTime::createFromFormat('d.m.Y H:i', $date);
if($date === false) return false;
return $date->format($output);
}
echo parse_austrian_date('1.2.12 24:14','d.m.Y H:i:s');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment