Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Date Time/DateComparison.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*Check whether the current date time is greater than start date time and less than end date time. add start and end date as per your need*/
var getCurrentDate = new GlideDateTime(); //getting the current date
var start = '2023-08-08 05:55:13';
var end = '2023-08-10 05:55:13';
if((getCurrentDate > start) && (getCurrentDate < end)){ //comparing the current date
    gs.print(start);
    gs.print(end)
}
else{
gs.print(getCurrentDate);
}