function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
iqbaliqbal 

How to retrieve the current Date/Time in Salesforce

How to retrieve the current Date/Time in Salesforce?
I tried Now() .
This is not working or Please tell me how to use NOW
 
 
 
 
thanks
iqbal
DevAngelDevAngel
I assume you mean in Apex code, and if so, use System.now();.


Vinodh MKVinodh MK

Try the following:

 

System.now() - for date time in GMT

System.today() - just the date

System.currentTimeMillis - returns the time in milli seconds