How to check day light savings is OFF or ON in Pega
Do we have a flag or any mechanism to check whether Day Light Savings is OFF or ON.
***Edited by Moderator Marissa to update platform capability tags****
Below is the approach you can follow in pega to know for the DayLight on or off. I followed and get the day light status
1) Create an activity and add an local variable as shown below
2) Implement the following steps in the activity
Java step : IsDayLight = java.util.TimeZone.getDefault().inDaylightTime( new Date() );
This api returns true or false. true means ON, false means OFF. You can use following api, if you want to get the day light value based on timezone
java.util.TimeZone.getTimeZone( "US/Alaska").inDaylightTime( new Date() );
The IsDayLighOn property is truefalse type in PEGA.
Save the activity and run it whenever needed in the application to see the value of the IsDaylightOn property is set to true or false.
I ran it on a button with "Refresh-this-Section and activity" and saw the result
The end result is
Thats It !. Hope this helps !!
Please feel free to reply for any questions,
Keep up to date on this post and subscribe to comments