Question
Accenture
US
Last activity: 7 Nov 2016 13:16 EST
Empty Date fields default to 19700101
When the customer submits empty date field values, Pega is defaulting the value to 01/01/1970. The dynamic system setting (DSS) "disableEpochDateTime" was set to true but it still displays a blank date as 19700101.
Steps to Reproduce
2. Send input date as blank and run the service.
3. In the response we could see 1970-01-01
**Updated by Moderator: Lochan. Removed user added helpme, Ask the Expert and SR Created tag. Apologies for confusion, shouldn't have been an end-user option; added Category***
***Updated by Moderator: Marissa to add SR Details***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hi Charan,
This is an expected behavior to set the Date to epoch date, that is 01-01-1970, when any java operations are performed on an empty Date/DateTime type property. But you can apply the following workaround to retain the empty date fields.
1) Add a java step in the file service activity and use following statement to get empty string out of date:
tools.getStepPage().putString("DateProp",com.pega.pegarules.pub.util.PRDateFormat.formatXSDDateTime(myStepPage.getDate(".pyLabel")));
NOTE:
(i) DateProp is the name of the date property, so replace that with the name of date property that is being used.
(ii) If there is more than one date property, repeat the statement with the date properties that are used.
2) Set the DSS disableEpochDateTime and disableEpochDate to true. (Owning ruleset : Pega-IntegrationEngine)
Hi Charan,
This is an expected behavior to set the Date to epoch date, that is 01-01-1970, when any java operations are performed on an empty Date/DateTime type property. But you can apply the following workaround to retain the empty date fields.
1) Add a java step in the file service activity and use following statement to get empty string out of date:
tools.getStepPage().putString("DateProp",com.pega.pegarules.pub.util.PRDateFormat.formatXSDDateTime(myStepPage.getDate(".pyLabel")));
NOTE:
(i) DateProp is the name of the date property, so replace that with the name of date property that is being used.
(ii) If there is more than one date property, repeat the statement with the date properties that are used.
2) Set the DSS disableEpochDateTime and disableEpochDate to true. (Owning ruleset : Pega-IntegrationEngine)
I hope this resolves your question.
Thank you.
Accenture
US
Hey,
Sorry it took me a while to respond to your post. Im still having the issue.
We are using Obj-Save to save the date field to the Database, I had to do a temporary work around in place for time being. Let me know if you have any more suggestions on this.
Thanks
Charan
Cognizant Technology Solutions
IN
Hi,
Is there any other way to resolve this problem, by using any function.
As I'm facing same problem,When propety is getting empty value or null in DT,bydefault it's taking 01-01-1970.
So I want that if it's come blank than it should displayed blank or null else should take mapped propery value.
Thanks
Rabobank
NL
I tried to change the property to text but still the same exception is throwing. Is there any work around on that?
Accenture
US
I Added a When condition to check for the date, to save it in the DB as null.
Accenture
US
I was able to do a temporary work around on this issue but I have to make sure I do it where ever I use this Date field so, looking for a fix which helps me to fix this issue throughout the application.
Thanks in advance
Charan
Cognizant Technology and Services
US
Hi,
Was there any solution for this, i am using PEGA 7.1.7 version and i didnot see the DSS disableEpochDate, disableEpochDateTime in this version.
Thanks,
Sahi
Cognizant Technology and Services
US
added the when condition before property-set and it worked...
kindly refer below link
https://community.pega.com/support/support-articles/blank-dates-displaying-1970
-
Richelle Ann Puraso Tharine Nagulendran