Created
June 29, 2018 05:08
-
-
Save kiran-machhewar/b70691da07e694d14bd441f5d8bff694 to your computer and use it in GitHub Desktop.
Get the DateTime from the Dates format which is GMT
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
/** | |
* @dateString : format should be like this 2018-06-10T12:34:15.29 | |
*/ | |
public DateTime parseDate(String dateString){ | |
String dateStringJSON = ('{ "thedate": "'+dateString+'"}'); | |
Map<String, DateTime> mockMap; | |
mockMap = (Map<String, DateTime>)JSON.deserialize(dateStringJSON, Map<String, DateTime>.class); | |
return mockMap.get('thedate'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment