Wednesday, August 9, 2023

How to convert timestamp to datetime using apex in salesforce

 Sample Code:

String timestamp = '2023-08-07T14:53:49Z';
timestamp = timestamp.replace('T', ' ');
System.debug('Datetime ==> '+DateTime.valueOf(timestamp));

Screenshot:




No comments:

Post a Comment