New answers tagged string
0
votes
Unable to convert a particular string format to DateTime
You can use JSON to correctly parse the values back into DateTime values.
DateTime dt1 = (DateTime)JSON.deserialize('"'+d1+'"', DateTime.class);
DateTime dt2 = (DateTime)JSON.deserialize('&...
0
votes
Unable to convert a particular string format to DateTime
Try using:
()..
DateTime dt1 = Datetime.valueOf(d1.replace('T',' '));
DateTime dt1 = Datetime.valueOf(d2.replace('T',' '));
Top 50 recent answers are included
Related Tags
string × 489apex × 328
json × 40
regular-expressions × 39
visualforce × 28
trigger × 20
soql × 19
list × 19
substring × 18
datetime × 15
map × 14
replaceall × 14
csv × 13
marketing-cloud × 12
class × 12
javascript × 11
ampscript × 10
rest-api × 9
date × 9
contains × 9
split × 9
lightning-aura-components × 8
email × 8
formula-field × 8
formatting × 8