Discussion

TimeZone conversion problem for DateTime functions

I'm using a Pega function "isDateInThePast()". For this function i have to pass a date value and the function will compare the input with the server's current date and time. Our server is in US/Central zone and this function is getting the systems date and converting it to GMT. So when we call this function after 7:00 PM Central then it is giving next day's date instead of current date. I know this is happening because, java uses GMT standards. I can override this function and rewrite the jave code to use Format function but i wanted to know whether there is a way to set time zone globally. I tried by setting it in Operator profile but it did not work. Can any one please help?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

Pega
May 19, 2009 - 6:19pm

You can write a Java Utility function and work with That. Add this function to your Library.

May 19, 2009 - 6:27pm

Hi MISHR, Thanks for your reply! I agree with your option and even i have that work arround working currently. But i need to know a better way to solve this problem. Like setting the TimeZone some where globally and functions like these should use it while manipulating.

July 27, 2009 - 10:58am

you can use Data-Admin-System-Settings to set the value and read the value in the function.

January 30, 2013 - 12:51pm

Hi Thamarai / Srinivas,

How have you overriden this functinality? Is it by hard coding the timezone as CST in the java code or something dynamic?

Quick response is appreciated.

{  I'm using a Pega function "isDateInThePast()". For this function i have to pass a date value and the function will compare the input with the server's current date and time. Our server is in US/Central zone and this function is getting the systems date and converting it to GMT. So when we call this function after 7:00 PM Central then it is giving next day's date instead of current date. I know this is happening because, java uses GMT standards. I can override this function and rewrite the jave code to use Format function but i wanted to know whether there is a way to set ti me zone globally. I tried by setting it in Operator profile but it did not work. Can any one please help? }

April 30, 2014 - 7:36am

What is final solution u found.Even i am also facing the same problem.

November 24, 2015 - 11:19pm

This should work.....@addToDate(@CurrentDateTime(), "", "-6", "", "")

 

It subtracts 6 hours from GMT which should give you your local time.