Skip to content

Instantly share code, notes, and snippets.

@imtrinity94
Created March 21, 2022 09:41
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 imtrinity94/3aec2c669565109922fe781117f7d724 to your computer and use it in GitHub Desktop.
Save imtrinity94/3aec2c669565109922fe781117f7d724 to your computer and use it in GitHub Desktop.
var date = new Date(Date.UTC()); //Mon Jan 01 1900 00:00:00 GMT-0000 (GMT)
System.log(date.toString()); //Fri Aug 23 1999 14:53:51 GMT-0000 (GMT)
System.log(date.toTimeString()); //14:53:51 GMT-0000 (GMT)
System.log(date.toLocaleTimeString()); //2:53:51 PM GMT
System.log(date.toLocaleDateString()); //January 6, 2009
System.log(date.toDateString()); //Tue Jan 06 2009
System.log(date.valueOf()); //1455062400000
System.log(date.toUTCString()); // Wed, 10 Feb 2016 00:00:00 GMT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment