Date range including military time

I have a start date, and end date, and a starttime and end time.

The starttime and end time are military times and 1/2 hour increments

starting at 0700 and ending at 1800.. so available times are

0700 0730 0800 0830 0900 0930 1000 1030 etc.

if my start date is 08/16/2021 and end date is 08/17/2021 and start time is 0700 and end time is 1200 for example, I would like a list such as :

08/16/2021 0700 : 08/16/2021 0730 : 08/16/2021 0800 : 08/16/2021 0830 : 08/16/2021 0900 : 08/16/2021 0930 : 08/16/2021 1000 : 08/16/2021 1030 : 08/16/2021 1100 : 08/16/2021 1130 : 08/16/2021 1200 : 08/17/2021 0700 : 08/17/2021 0730 : 08/17/2021 0800 : 08/17/2021 0830 : 08/17/2021 0900 : 08/17/2021 0930 : 08/17/2021 1000 : 08/17/2021 1030 : 08/17/2021 1100 : 08/17/2021 1130 : 08/17/2021 1200

I don't think I can use date range since I'm using military time.. probably I'll just have to loop through and generate my own list..

HI Betsy,

I can't think of a way to use the NotesDateRange class to accomplish what you are wanting to do hear. I would suggest using a List to do this. Set a NotesDateTime object for the start Date/time. Log that as the first entry to the list and then use the adjust Minutes to set the time forward 30 minutes at a time until you reach your end date/time, adding each new date/time as a new entry to the list. I prefer using lists over arrays personally.

Paul Albright
Technical Team Lead - Application Development Team
Notes/Domino/HEI/Volt
Customer Support

I haven't messed with lists in a long time. I wonder about the military time issue..

Like 01:00 pm = 1300

Oh, and also, thank you for replying.. I really appreciate it.

Hi Betsy,

You can use arrays or string lists if you prefer, I mentioned arrays as I like them better. :-)

As far as getting the military time, you can just use the LS format function - https://help.hcltechsw.com/dom_designer/10.0.1/basic/LSAZ_FORMAT_FUNCTION.html

The format I think you want here is Short Time

Short Time

Hours (0 - 23) and minutes using only the time separator.

Paul Albright
Technical Team Lead - Application Development Team
Notes/Domino/HEI/Volt
Customer Support

Haven't tested this code, but something like the following should to it:

dates := "08/16/2021" : "08/17/2021";

times := "0700" : "0730" : "0800" : "0830" : "0900" : "0930" : "1000" : "1030"...;

datetimes := (dates + " ") *+ times;

I assume, you need a test list.

With a little more of formula magic, you could generate the dates and the times lists.

With @for and @adjust or a date range and @text you could generate the dates list.

For the times list, you could create a complete list from 0000 to 2330 and use @transform to select only those between start and end time.