What is Data Type of ActivityDate (Due Date) field on Task Object?

On the Task’s field setup page, the ActivityDate is described as Date/Time but when I try to assign a DateTime variable to it, then I receive this error

t.ActivityDate = DateTime.now() //this line of code created below error

Illegal assignment from Datetime to Date

When I assign a Date, then no error.

t.ActivityDate = Date.today() //This works fine

Salesforce documentation also suggests it is a Date field.

My question is, is this a mistake on part of Salesforce or Bug or am I missing something?

enter image description here


It’s not a bug, DueDate Datatype itself is ‘Date’ not Date/Time.enter image description here

Source : Link , Question Author : abdn , Answer Author : chandana kk

Leave a Comment