Command Reference : String and Date Function Reference
Syntax: @datefloor(d1, u[, step])
Argument 1: date number, d1
Argument 2: time unit, u
Argument 3: step, step
Return: date number
Finds the first possible date number defined by d1 in the regular frequency defined by the given time unit u and optional step step. The frequency is defined relative to the basedate of Midnight, January 2001.
The valid time unit string values are: “A” or “Y” (annual), “S” (semi-annual), “Q” (quarters), “MM” (months), “WW” (weeks), “DD” (days), “B” (business days), “HH” (hours), “MI” (minutes), “SS” (seconds).
If step is omitted, the frequency will use a step of 1 so that by default, @datefloor will find the beginning of the period defined by the time unit.
Suppose that date1 is 730110.8 (7 PM, December 23, 1999). Then the @datefloor values
@datefloor(730110.8, "dd")
@datefloor(730110.8, "mm")
yield 730110.0 (midnight, December 23, 1999) and 730088.0 (midnight, December 1, 1999), the date numbers for the beginning of the day and month associated with 730110.8, respectively.
@datefloor(730110.8, "hh", 6)
@datefloor(730110.8, "hh", 12)
return 730110.75 (6 PM, December 23, 1999), and 730110.5 (Noon, December 23, 1999), which are the earliest date numbers for 6 and 12 hour regular frequencies anchored at Midnight, January 1, 2001.