semiMonthBegin#

swordfish.function.semiMonthBegin()#

Return the first day of the semi-month that X belongs to. Suppose X is the d-th day of the month:

  • If d < dayOfMonth: return the first day of the month.

  • If d >= dayOfMonth: return the dayOfMonth-th day of the month.

If parameter offset is specified, the result is updated every n semi-months. The parameters offset and n must be specified together, and offset takes effect only when n > 1.

Parameters:
  • X (Constant) – A scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.

  • dayOfMonth (Constant, optional) – A n integer between 2 and 27, by default DFLT.

  • offset (Constant, optional) – A scalar of the same data type as X. It must be no greater than the minimum value of X, by default DFLT.

  • n (Constant, optional) – A positive integer, by default DFLT.