Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..
747 views

strange date issue

We are having HP SM v9.20
Time zone: US / Pacific

I have a schedule which triggers a javascript , javascript basically queries cm3r and checks if there are any
change requests 'pending approval' and is scheduled to be implemented in the next 24 hrs. If there is any,
it triggers a notification to the assignee or coordinator of the change.

So far for the last 1 year, I havent had any issues with this script (its a straight forward script). Now in the
last week, one of the user reported that date in the email is not matching with the date in the change record.
The date in the email is showing GMT timestamp, whereas our application is on US/Pacific timezone.

I had checked the operator record of the user to see if his timezone value is set to other than US/Pacific , its rightly
set to PST.

I tried logging the date values for each change request in the log, it all correctly shows the PST hours. I added my
email address to verify if its happening always. The very next day, i got the emails and it were all reflecting right
PST values. I ran the schedule manually and it all generated emails with the right timezone date values.

Yesterday, while verifying the emails , all the emails are having GMT timestamp. I am amazed as I am not able to find a logical
reasoning for this issue. When I ran the schedule manually, it again generated emails with the right timestamp values.

Attached is the script which gets triggered by the schedule.

Thx

I am Listening..
Tags (1)
0 Likes
7 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: strange date issue

attaced script

I am Listening..
0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: strange date issue

When i print the planned.start and planned.end in the script, it prints the right value in the log. Once it reaches the notification, i started logging the dates from there. Strangely, it started showing me the GMT timestamp there. Now , as the last step, what I have done is I have moved the planned.start and planned.end to specific global variables and started using these variables as the arguments in the notification. Could someone suggest me other better way of scheduling Emailing notifications on change requests ? Can I do , script.execute.bg from the schedule record and call us.notify from the RAD .
I am Listening..
0 Likes
Highlighted
Established Member..
Established Member..

Re: strange date issue

Hey Brav0, no idea if this will help, but i recall something similar happening when a server guy decided to change the Windows timezone on the server from GMT to Local. Don't suppose something like that happened? Strange that it started happening after working for so long.

Otherwise, i guess it looks like operator settings, your operator is in PST, so when you run it, it's fine. What user is running the schedule, does it have a timezone setting?

 

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: strange date issue

the schedule is running under the report process. As I mentioned, i am logging the emails whenever the calll comes in the notification record. Strangely yesterday it shows the correct dates and todays emails it all changed to GMT. Now I am passing the start and end date to another global variable and is using that in the arguments. Did a test run, and it worked. What is the other option of achieving this ? Can i call script.execute.bg frm the schedule and try doing the same thing using rad scripts ?
I am Listening..
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: strange date issue

Hi Bravo,

Does your scheduler class has any operator record ? One way is to create an operator record for scheduler class. Didnt try it but this should work.

You may Check the timezone of the scheduler class in operator table.  You can use any scheduler , just verify the timezones of logged in user  , schedulers class's operator record , server timezone. 

 

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: strange date issue

Since this has to run in the background, i think we need to have the system process take care of the schedule. Incase if I try to run it with a specific user, then i need to add that user into the system info to make it run as a process. Moreover all the users in the operator are in PST, only a handful of users are in EST.
I am Listening..
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: strange date issue

If allowed you can create operator record of system process as well , such as report,event,linker etc.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.