I am new to Rexx. I have a rqmt to process the daylight saving in a existing program which simply sends mail to the users with date/time.
It impacts the hrs due to daylight saving.
beginning and end of daylight saving: 2nd Sunday of march & 1st Sunday of November.
current Scenario: We use EST to use SMTP to send mails
but once the daylight saving starts from 2nd Sunday of march, then we should have to use EDT time to sync, If we use EST, then we will be off by 1 hour.
May be 1st I need to fetch the 2nd Sunday from March month and 1st Sunday from November.
then need to calculate whether it falls within this daylight duration, if yes, then I can use EDT else EST.
Any suggestion/approach to achieve this.
You can set a base date, 1st of Month, find which day of the week it is, and work forward until you hit the relevant Sunday for that month to get the right dates. Repeat for second relevant month and associated condition.
Or rather than execute the code over and over every time that you run this thing, you could consider building a control record for the year so you only ever need to perform the calculation once a year and just compare the current date against the control record.
If current date GE lower_date_value and LE higher_date_value then use time1 else use time2.