+ Start a Discussion
Jyoti Singh 9Jyoti Singh 9 

Get current date in Apex

How do I get the current date in Apex?
Best Answer chosen by Jyoti Singh 9
Gaurav KheterpalGaurav Kheterpal
Simply use the Date class like this
 
Date todaysDate = system.today();
I hope this helps.

If my answer helps resolve your query, please mark it as the 'Best Answer' to benefit others and improve the overall quality of Discussion Forums.
 

All Answers

Gaurav KheterpalGaurav Kheterpal
Simply use the Date class like this
 
Date todaysDate = system.today();
I hope this helps.

If my answer helps resolve your query, please mark it as the 'Best Answer' to benefit others and improve the overall quality of Discussion Forums.
 
This was selected as the best answer
Jyoti Singh 9Jyoti Singh 9
Thank you!