New answers tagged datetime
1
vote
Change the CreatedDate format in Apex
Yes, look through the Datetime class documentation to see how to use the format() method (the one that takes a formatting string)
0
votes
String to DateTime Conversion
Ideally, you'll want to use Datetime.valueOf(stringDate) or Datetime.valueOfGmt(stringDate) where stringDate is of the format yyyy-MM-dd HH:mm:ss
If you do not have control over the creation of the ...
0
votes
String to DateTime Conversion
The first thing that I noticed is a missing comma after the date value, so the string date value should be '10/14/2011, 11:46:00 AM'
You might also need to enable the ICU locale formats, please visit ...
0
votes
How to set a Date in apex test class?
Another option is using system.today().addDays(10)
acc.effectiveDate__c = System.today().addDays(10);
Top 50 recent answers are included
Related Tags
datetime × 686apex × 300
date × 156
timezone × 84
formula × 65
visualforce × 52
soql × 50
marketing-cloud × 46
formula-field × 35
time × 33
formatting × 23
ampscript × 21
lightning-aura-components × 20
json × 20
trigger × 18
lightning × 18
process-builder × 16
format × 16
lightning-web-components × 15
query × 14
javascript × 13
businesshours × 13
unit-test × 12
rest-api × 12
string × 12