Skip to content

Instantly share code, notes, and snippets.

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 trungdq88/84e37aa3cfd68ce278ea to your computer and use it in GitHub Desktop.
Save trungdq88/84e37aa3cfd68ce278ea to your computer and use it in GitHub Desktop.
Short date operation
s='substring';
a=20140702230000+'';
d=new Date(a[s](0,4)+'-'+a[s](4,6)+'-'+a[s](6,8)+'T'+a[s](8,10)+':'+a[s](10,12)+':'+a[s](12,14)+'.000Z');
d=(new Date(d-3600000)).toISOString().split('-').join('').split('T').join('').split(':').join('').split('.')[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment