Implicit Date to Datetime conversion inspection

Issue #1009 new
Phil Weighill-Smith created an issue

It would be very useful to have an Apex inspection that can identify all usages of implicit date to date time conversion because this fails to consider time zones (always resulting in a value based on UTC/GMT). An implicit conversion is applied when assigning a Date to a Datetime variable or when there is an implicit or explicit requirement for a cast from Date to Datetime.

The explicit conversion equivalent, typically of the form Datetime.newInstance(theDate, Time.newInstance(0,0,0,0)), does address the time zone.

Comments (0)

  1. Log in to comment