System vs Date/DateTime class

They give you the same data. Their descriptions are almost verbatim as well:

System.now()
Returns the current date and time in the GMT time zone.

Datetime.now()
Returns the current Datetime based on a GMT calendar.

And for today they are indeed verbatim:

System.today()
Returns the current date in the current user's time zone.

Date.today()
Returns the current date in the current user's time zone.

If you care about character count, Date.today() is more efficient than using System, but System.now() is more efficient than using Datetime. Either way, it's a two character difference.


There is actually a performance difference as well. Note that even slower executions will take less than 5 microseconds, so this difference is not likely to affect your code performance on the whole unless you are calling these methods millions of times.

  • For Date.today(), the cost per invocation is about 4.43µs, whereas System.today() costs about 3.85µs per invocation, a difference of about ~15%.
  • For Datetime.now(), the cost per invocation is about 3.48µs, whereas System.now() costs about 2.97µs per invocation, a difference of ~17%.

Historically, only the System methods were originally available (System.now and System.today). The newer methods were added later, presumably because people felt it was logical that you'd find the current date in a class called Date, and the current time in a class called DateTime. They are exactly identical in behavior, so feel free to use whichever you prefer.