I have a custom field on Cases which pulls the ‘Start date’ of the last created Appointment activity attached to the Case. It works splendidly, except that the time is wrong. It’s five hours different:

The field definition is:
namespace CaseWorkflow
{
public class CaseWorkflow_CRCaseExt : PXCacheExtension<CRCase>
{
#region UsrAppointmentDate
[PXDateAndTime(InputMask = "g", DisplayMask = "g")]
[PXFormula(typeof(TimeZoneNow))]
[PXDBScalar(typeof(SearchFor<CRActivity.startDate>.
In<
SelectFrom<CRActivity>.
Where<CRActivity.refNoteID.IsEqual<CRCase.noteID>.
And<CRActivity.type.IsEqual<appointmentType>>>.
OrderBy<CRActivity.createdDateTime.Desc>>))]
[PXUIField(DisplayName = "Appointment Date", Enabled = false)]
public virtual DateTime? UsrAppointmentDate { get; set; }
public abstract class usrAppointmentDate : PX.Data.BQL.BqlDateTime.Field<usrAppointmentDate> { }
#endregion
}
public class appointmentType : PX.Data.BQL.BqlString.Constant<appointmentType>
{
public appointmentType() : base(ActivityTypes.Appointment) { }
}
}
It seems like a time zone or formatting issue, but I can’t find any documentation on what could be wrong.