Last active
July 31, 2022 17:32
-
-
Save sbutterfield/32b1a29008de364f1d390ef80f38b9ea to your computer and use it in GitHub Desktop.
sfdc-datetime-to-groovy2.4-date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.DateFormat | |
import java.text.SimpleDateFormat | |
// def inputDatTimeString = "2015-07-23T13:46:00.000Z" | |
def inputDatTimeString = "2015-07-23T14:06:00.000Z" | |
DateFormat inputDateTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX") | |
// X instead of 'Z' | |
// inputDateTimeFormat.setTimeZone(TimeZone.getTimeZone("GMT")) | |
def date = inputDateTimeFormat.parse(inputDatTimeString) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment