Why am I not getting consistent results when using the System.Date macro?

Issue

When using the System.Date macro to pass the system date to a .NET control on your web form, you may notice that you do not consistently receive the correct date.

Background

System.Date is an action macro that dates back to version 4 of WorkflowGen. Since version 4 did not support time zone management, it was never an issue. However, with the introduction of time zone management to versions 5+, WorkflowGen requires the time of day to accurately display dates since it is now taking the user’s time zone into consideration.

Solution

It is best practice to use System.DateTime when passing the system date as an IN parameter to a .NET control such as a textbox or label. On your web form, you can then set the WorkflowGen.My FieldDataType WorkflowGen.My extended attribute to DateTime (to correspond with the System.DateTime context you are passing in). It is using the FieldFormat attribute that you specify the desired format of the date for display purposes.

Example

<asp:TextBox FieldDataType ="DateTime" FieldFormat ="{0:d}" ID ="TEXT_BOX_DATE_TIME" runat ="server"></ asp:TextBox >

For more information, see Field data type in the WorkflowGen Web Forms for Visual Studio Developer Guide.