GlideDateTime - getSpanTime(Number dayOfWeek)

Gets the amount of time elapsed since the midnight of a specified day to the current time.

Table 1. Parameters
Name Type Description
dayOfWeek Number Day of week value from 1 to 7. 1 = Monday, 7=Sunday.
Table 2. Returns
Type Description
GlideTime The amount of time elapsed since midnight of the specified day. To display the result in user-friendly terms, set the value to GlideDuration.

var gdt = new GlideDateTime("2011-08-31 08:00:00"); //Wednesday
var dur = new GlideDuration();
 
var span = gdt.getSpanTime(1); //how much time since Monday 00:00:00
dur.setValue(span);
gs.print(dur.getDisplayValue());

Output: 2 Days 8 Hours