How to get Current hour in Scheduled job script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2023 12:07 AM
Hi,
I'm trying to get the current hour and minute in Scheduled job script but I don't know how to get it . Can someone help here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2023 12:30 AM
@Akki1 You can try javascript date object
var currentTime = new Date();
var year = currentTime.getFullYear();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var seconds = currentTime.getSeconds();
gs.print('currentTime :' + currentTime);
gs.print('hours :' + hours);
gs.print('minutes :' + minutes);
gs.print('seconds :' + seconds);
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!