New answers tagged datetime
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
datetime × 732apex × 312
date × 165
timezone × 86
formula × 71
visualforce × 52
soql × 52
marketing-cloud × 50
formula-field × 43
time × 36
formatting × 25
ampscript × 23
json × 22
lightning × 20
lightning-web-components × 20
lightning-aura-components × 19
trigger × 19
format × 18
javascript × 16
query × 15
string × 15
process-builder × 14
visual-workflow × 13
businesshours × 13
unit-test × 12