Skip to content

Instantly share code, notes, and snippets.

@danmux
Created June 12, 2011 16:58
Show Gist options
  • Save danmux/1021756 to your computer and use it in GitHub Desktop.
Save danmux/1021756 to your computer and use it in GitHub Desktop.
parsing date string into a date object on iOs
// iOs or mobile webkit hacking
var syncdate = null;
if(model.synchdate) {
var arr = model.synchdate.split(/[- :T]/);
syncdate = new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment