# Incorrect Date to date time property conversion

**URL:** <https://forums.pega.com/t/incorrect-date-to-date-time-property-conversion/1363>\
**Category:** User Experience\
**Tags:** 8-2-1, healthcare-and-life-sciences, user-experience, case-management\
**Created:** [April 30, 2021, 4:23am UTC](https://forums.pega.com/t/incorrect-date-to-date-time-property-conversion/1363 "2021-04-30T04:23:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KAILASHC](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@KAILASHC](https://forums.pega.com/u/KAILASHC)\
**Post date:** [April 30, 2021, 4:23am UTC](https://forums.pega.com/t/incorrect-date-to-date-time-property-conversion/1363/1 "2021-04-30T04:23:55Z")

</div>

I have date property whose value get set to another datetime property. Date time property value get the time GMT and shows one day less.

Server is on EST time zone

For example:

DateProp Property = 20210430

Do a property set to DateTimeProp = DateProp

Value of DateTime Prop = 20210430T000000.000 GMT which is nothing but 20210429 in eastern time.

Since server is in eastern time zone, it should convert the date to datetime equivalent is EST.

Is there way to achieve this?

---

<div class="post-metadata">

**Author:** ![MarcLasserre\_GCS](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@MarcLasserre\_GCS](https://forums.pega.com/u/MarcLasserre_GCS)\
**Post date:** [May 3, 2021, 6:53am UTC](https://forums.pega.com/t/incorrect-date-to-date-time-property-conversion/1363/2 "2021-05-03T06:53:20Z")

</div>

@KAILASHC

Can this be helpful: [How to convert Date to DateTime format | Support Center](https://collaborate.pega.com/question/how-convert-date-datetime-format)

---

<div class="post-metadata">

**Author:** ![Vaishnavi\_Batchu](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@Vaishnavi\_Batchu](https://forums.pega.com/u/Vaishnavi_Batchu)\
**Post date:** [July 9, 2021, 3:14pm UTC](https://forums.pega.com/t/incorrect-date-to-date-time-property-conversion/1363/3 "2021-07-09T15:14:07Z")

</div>

@KAILASHC Can you try using the below function for DateTime conversion and let me know if that works.

FormatDateTime(@DateTime.CurrentDateTime(),DDmmYYYYThhMMss,EST,“”)

Thanks

---

<div class="post-metadata">

**Author:** ![KAILASHC](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@KAILASHC](https://forums.pega.com/u/KAILASHC)\
**Post date:** [July 9, 2021, 5:22pm UTC](https://forums.pega.com/t/incorrect-date-to-date-time-property-conversion/1363/4 "2021-07-09T17:22:30Z")

</div>

@KAILASHC

Update on this thread, I was able to achieve desired results by using function below

@(Pega-RULES:DateTime).pxGetSpecifiedTimeOnDate(InputDate,0,0,0,“America/New\_York”)
