I have an input field that is binding to a backing Task in the controller to allow users to enter a date into the ActivityDate field.
I'm not interested in any other fields on the Task. I'm just using it as a mechanism to get the date picker.
Controller:
public Task startDateTask {get; set;}
Page:
<apex:inputField value="{!startDateTask.ActivityDate}"/>
Taking into account the users time zone offset, how can I determine the Date the user entered in UTC/GMT?
The Date primitive data type doesn't appear to have any of the GMT methods that DateTime has. This makes sense, as there is no offset information in just a date without a time.
But when a user that is in a UTC +12 timezone enters the same date as a UTC -10 user they are not talking about the same day of the year. This causes issues when passing the dates off to a web service.