- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 07:54 AM
Hi,
some one please suggest me how to get Hours only from new GlideDateTime()).getLocalTime().
all client systems are running in PST zone.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 01:47 PM
Edited the script
if (gdt.getDayOfWeekUTC() == 2) //Tuesday 2 7AM PST (-7)
{
if (gdtH.getHourOfDayUTC() == 14) {//GMT
email.setSubject("Gentle Reminder for TimeCard Approval of the week starts on " + par1.lastWeek);
email.addAddress("cc", par1.manager_email, par1.manager_name);
template.print('Hi ' + par1.user + ',</br></br>This is a gentle reminder, that the Timecards in Submitted State are overdue, for the week starts on, "' + par1.lastWeek + '" in the system. Kindly Approve or Reject the timecards last by 3PM PST. </br></br>');
template.print('<br/>');
}
}
if (gdt.getDayOfWeekUTC() == 3) //Wednesday 3 1AM = tuesday 2 6PM PST (-7)
{
if (gdtH.getHourOfDayUTC() == 1) { //GMT
email.setSubject("Final Reminder for TimeCard Approval of the week starts on " + par1.lastWeek);
email.addAddress("cc", par1.manager_email, par1.manager_name);
template.print('Hi ' + par1.user + ',</br></br>This is a final reminder, that timecard approval for the below Employees are overdue for the week starts on, "' + par1.lastWeek + '" in the system and needs immediate approval. </br></br>');
template.print('<br/>');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 01:51 PM
i edited the script accordingly, please verify yourself
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 01:59 PM
Thanks Pranesh, i think i m giving more trouble to you.sorry for that.
1. what ever the time zone system may have. now script will run GMT always right ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 02:01 PM
what ever the time zone system may have. now script will run GMT always right ? - exactly
yeah seems correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 02:02 PM
2. Is it correct ?
var gdt = new GlideDateTime(gs.beginningOfLastWeek());
var last_week = gdt.getDate();
gs.info('Last week reminder for approver :' + last_week);
var day = gdt.getDayOfWeekUTC();
if (gdt.getDayOfWeekUTC() == 7) // Sunday
{
3. How to get Current day(today date ) of week number
like monday or tuesday, wed.. as per UTC code. get week number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 02:05 PM
2. looks right
3.
var gdt = new GlideDateTime();
gs.info(gdt.getDayOfWeekUTC());