Home:ALL Converter>Groovy - Convert a timestamp string to Epoch time in milliseconds

Groovy - Convert a timestamp string to Epoch time in milliseconds

Ask Time:2017-11-21T08:53:31         Author:activelearner

Json Formatter

I have a timestamp string as follows:

String build_time=2017-11-20T21:27:03Z

I want to convert it into epoch time in milliseconds as per the PST time zone such that my result is:

long build_time_ms=1511299623000

How can I do this?

Author:activelearner,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/47403542/groovy-convert-a-timestamp-string-to-epoch-time-in-milliseconds
yy