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

**URL:** <https://discuss.workflowgen.com/t/why-am-i-not-getting-consistent-results-when-using-the-system-date-macro/160>\
**Category:** Visual Studio Web Forms\
**Created:** [September 8, 2008, 11:59pm UTC](https://discuss.workflowgen.com/t/why-am-i-not-getting-consistent-results-when-using-the-system-date-macro/160 "2008-09-08T23:59:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [September 8, 2008, 11:59pm UTC](https://discuss.workflowgen.com/t/why-am-i-not-getting-consistent-results-when-using-the-system-date-macro/160/1 "2008-09-08T23:59:00Z")

</div>

### 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

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

```

For more information, see [Field data type](https://docs.advantys.com/workflowgen-web-forms-for-visual-studio-developer/web-form-development-simple-mode#field-data-type) in the [WorkflowGen Web Forms for Visual Studio Developer Guide](https://docs.advantys.com/workflowgen-web-forms-for-visual-studio-developer).
