Skip to content

Instantly share code, notes, and snippets.

@hyperNURb
Created January 23, 2015 12:13
Show Gist options
  • Save hyperNURb/33c04fa0b4e996ae0d85 to your computer and use it in GitHub Desktop.
Save hyperNURb/33c04fa0b4e996ae0d85 to your computer and use it in GitHub Desktop.
if (str) {
var dateArr = _.map('2015-01-29 16:16:00'.split(/[\:\-\s]/g), function (num) { return +num; });
return new Date(dateArr[0], dateArr[1]-1, dateArr[2], dateArr[3], dateArr[4]);
}
return new Date();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment