Skip to content

Instantly share code, notes, and snippets.

@aimtiaz11
Last active September 13, 2021 12:50
Show Gist options
  • Select an option

  • Save aimtiaz11/60b7fc360e7738644320d94b5ae80ad8 to your computer and use it in GitHub Desktop.

Select an option

Save aimtiaz11/60b7fc360e7738644320d94b5ae80ad8 to your computer and use it in GitHub Desktop.
Goovy Timestamp Prase

Groovy Timestamp Parse

Code:

// Task 3: Format Timestamp
println(Date.parse("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", '2021-05-24T11:42:08.875Z').format('yyyyMMddHHmmss'));
println(Date.parse("yyyy-MM-dd'T'HH:mm:ss.SSSX", '2021-05-24T11:42:08.875Z').format('yyyyMMddHHmmss'));

Output:

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