Skip to content

Instantly share code, notes, and snippets.

@pipedreambomb
Last active September 1, 2016 18:14
Show Gist options
  • Save pipedreambomb/d65ec95281e598f4012bf87ba9f4ed1d to your computer and use it in GitHub Desktop.
Save pipedreambomb/d65ec95281e598f4012bf87ba9f4ed1d to your computer and use it in GitHub Desktop.
<span id='date-me'></span>
<script type='text/JavaScript'>document.getElementById('date-me').innerHTML = new Date(Date.parse('Wed, 09 Aug 1995 00:00:00 GMT')).toLocaleString()</script>
@pipedreambomb
Copy link
Author

Update: I found Date.parse() does work with UTC as long as the string is formatted in one of a few supported ways.

I think outputting a DateTime as RoundTrip ought to do it.
https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Roundtrip
Might need to set the DateTimeKind first:
https://msdn.microsoft.com/en-us/library/system.datetime.specifykind(v=vs.110).aspx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment