Sunday, 23 April 2017

Convert yyyymmddThhmmss.SSSZ format to Unix Timestmp

I'm using NodeJS to fetch a date from a server, but the date format is yyyymmddThhmmss.SSSZ

20170423T203146.000Z 

I'm trying to convert this date string into epoch time, to easily calculate a difference between this time and the current time. (the timezone will always be UTC)

However, I could not find any possibility to parse this string, since libraries don't seem to accept this kind of date string.

Can someone help me out with this?



via Werner der Champ

No comments:

Post a Comment