You need to sign in to do that
Don't have an account?
Pedro Paiva
Datetime format from Drive Api Human Readable
Hi, i am struggling to properly show the modifiedTime got from the Google Drive API in a more human readable way.
My first tough was to first convert the field (modifiedTime) into DateTime object, but i am having issues with the format.
This is the date i am getting from the API : 2018-03-21T18:49:58.867Z and i would like to show it in a more human readable way, maybe like this: 21 March 2018, 6:49 pm
I tried to do this:
Any help would be appreciate, thanks in advance.
My first tough was to first convert the field (modifiedTime) into DateTime object, but i am having issues with the format.
This is the date i am getting from the API : 2018-03-21T18:49:58.867Z and i would like to show it in a more human readable way, maybe like this: 21 March 2018, 6:49 pm
I tried to do this:
String modifiedTime = String.valueOf(mapResultFile.get('modifiedTime')); Datetime dt = Datetime.parse(modifiedTime); // OR String format = 'yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\''; DateTime dt = new DateTime(); dt.format(format);But without success, i searched if Apex has something like SimpleDateFormat like Java to try something like this, but couldn't find some good example of it in Apex.
Any help would be appreciate, thanks in advance.
https://salesforce.stackexchange.com/questions/1013/parsing-an-iso-8601-timestamp-to-a-datetime
Now i need to convert the DateTime in a more human readable way