Skip to content

Instantly share code, notes, and snippets.

@jgarber623
Created December 1, 2011 19:44
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 jgarber623/1419299 to your computer and use it in GitHub Desktop.
Save jgarber623/1419299 to your computer and use it in GitHub Desktop.
A couple of JS date utilities I used on a recent project
var date_utils = {
shift: function( date_obj, delta_in_days ) {
return new Date( date_obj.getTime() + ( delta_in_days * 86400000 ) );
},
epochTime: function( date_obj ) {
return date_obj.getTime();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment