2024 April Release

Class FSCEXPEXT@1.1001:DateUtilsFunctions Permanent link for this heading

DateUtilsFunctions Functions.

Note: the handling of daylight saving time (DST) is is platform specific. This means that a different OS can give different results.

Class Hierarchy

Object > ComponentObject > DateUtilsFunctions

Actions Permanent link for this heading

Return Type

Signature

datetime

AddDays(
  datetime dt,
  integer amount,
  out retval datetime result)

datetime

AddHours(
  datetime dt,
  integer amount,
  out retval datetime result)

datetime

AddMinutes(
  datetime dt,
  integer amount,
  out retval datetime result)

datetime

AddMonths(
  datetime dt,
  integer amount,
  out retval datetime result)

datetime

AddSeconds(
  datetime dt,
  integer amount,
  out retval datetime result)

datetime

AddWeeks(
  datetime dt,
  integer amount,
  out retval datetime result)

datetime

AddYears(
  datetime dt,
  integer amount,
  out retval datetime result)

integer

CountDays(
  datetime dt1,
  datetime dt2,
  out retval integer result)

integer

CountHours(
  datetime dt1,
  datetime dt2,
  out retval integer result)

integer

CountMinutes(
  datetime dt1,
  datetime dt2,
  out retval integer result)

integer

CountMonths(
  datetime dt1,
  datetime dt2,
  out retval integer result)

integer

CountSeconds(
  datetime dt1,
  datetime dt2,
  out retval integer result)

integer

CountWeeks(
  datetime dt1,
  datetime dt2,
  out retval integer result)

integer

CountYears(
  datetime dt1,
  datetime dt2,
  out retval integer result)

datetime

DateCeiling(
  datetime dt,
  ModifyDateTimeOperand operand,
  out retval datetime result)

datetime

DateRound(
  datetime dt,
  ModifyDateTimeOperand operand,
  out retval datetime result)

datetime

DateTruncate(
  datetime dt,
  ModifyDateTimeOperand operand,
  out retval datetime result)

integer

GetDayInWeek(
  datetime dt,
  out retval integer result)

integer

GetDayInYear(
  datetime dt,
  out retval integer result)

boolean

IsSameDay(
  datetime dt1,
  datetime dt2,
  out retval boolean result)

integer

TruncatedCompares(
  datetime dt1,
  datetime dt2,
  ModifyDateTimeOperand operand,
  out retval integer result)

boolean

TruncatedEquals(
  datetime dt1,
  datetime dt2,
  ModifyDateTimeOperand operand,
  out retval boolean result)

Actions Permanent link for this heading


FSCEXPEXT@1.1001:AddDays Permanent link for this heading

Adds a number of days to a date.
Note: Daylight saving time (DST) is not considered.
#DateUtils.AddDays(null, *)               = null
#DateUtils.AddDays(date, null)            = date
#DateUtils.AddDays(2002-03-28T13:45, 2)   = 2002-03-30T13:45
#DateUtils.AddDays(2002-03-28T13:45, 14)  = 2002-04-11T13:45
#DateUtils.AddDays(2002-03-28T13:45, -2)  = 2002-03-26T13:45
#DateUtils.AddDays(2002-03-28T13:45, -29) = 2002-02-27T13:45

datetime FSCEXPEXT@1.1001:AddDays(
  datetime dt,
  integer amount,
  out retval datetime result)

Name

Description

dt

the date

amount

the amount to add, may be negative

result

the new date

FSCEXPEXT@1.1001:AddHours Permanent link for this heading

Adds a number of hours to a date.
Note: Daylight saving time (DST) is not considered.
#DateUtils.AddHours(null, *)               = null
#DateUtils.AddHours(date, null)            = date
#DateUtils.AddHours(2002-03-28T13:45, 2)   = 2002-03-28T15:45
#DateUtils.AddHours(2002-03-28T13:45, 14)  = 2002-03-29T03:45
#DateUtils.AddHours(2002-03-28T13:45, -2)  = 2002-03-28T11:45
#DateUtils.AddHours(2002-03-28T13:45, -29) = 2002-03-27T08:45

datetime FSCEXPEXT@1.1001:AddHours(
  datetime dt,
  integer amount,
  out retval datetime result)

Name

Description

dt

the date

amount

the amount to add, may be negative

result

the new date

FSCEXPEXT@1.1001:AddMinutes Permanent link for this heading

Adds a number of minutes to a date.
Note: Daylight saving time (DST) is not considered.
#DateUtils.AddMinutes(null, *)               = null
#DateUtils.AddMinutes(date, null)            = date
#DateUtils.AddMinutes(2002-03-28T13:45, 2)   = 2002-03-28T13:47
#DateUtils.AddMinutes(2002-03-28T13:45, 16)  = 2002-03-28T14:01
#DateUtils.AddMinutes(2002-03-28T13:45, -2)  = 2002-03-28T13:43
#DateUtils.AddMinutes(2002-03-28T13:45, -46) = 2002-03-28T12:59

datetime FSCEXPEXT@1.1001:AddMinutes(
  datetime dt,
  integer amount,
  out retval datetime result)

Name

Description

dt

the date

amount

the amount to add, may be negative

result

the new date

FSCEXPEXT@1.1001:AddMonths Permanent link for this heading

Adds a number of months to a date.
Note: Daylight saving time (DST) is not considered.
#DateUtils.AddMonths(null, *)               = null
#DateUtils.AddMonths(date, null)            = date
#DateUtils.AddMonths(2002-03-28T13:45, 2)   = 2002-05-28T13:45
#DateUtils.AddMonths(2002-03-28T13:45, 14)  = 2003-05-28T13:45
#DateUtils.AddMonths(2002-03-28T13:45, -2)  = 2002-01-28T13:45
#DateUtils.AddMonths(2002-03-28T13:45, -14) = 2001-01-28T13:45

datetime FSCEXPEXT@1.1001:AddMonths(
  datetime dt,
  integer amount,
  out retval datetime result)

Name

Description

dt

the date

amount

the amount to add, may be negative

result

the new date

FSCEXPEXT@1.1001:AddSeconds Permanent link for this heading

Adds a number of seconds to a date.
Note: Daylight saving time (DST) is not considered.
#DateUtils.AddSeconds(null, *)               = null
#DateUtils.AddSeconds(date, null)            = date
#DateUtils.AddSeconds(2002-03-28T13:45, 2)   = 2002-03-28T13:45:02
#DateUtils.AddSeconds(2002-03-28T13:45, 61)  = 2002-03-28T13:46:01
#DateUtils.AddSeconds(2002-03-28T13:45, -2)  = 2002-03-28T13:44:58
#DateUtils.AddSeconds(2002-03-28T13:45, -69) = 2002-03-28T13:43:51

datetime FSCEXPEXT@1.1001:AddSeconds(
  datetime dt,
  integer amount,
  out retval datetime result)

Name

Description

dt

the datetime

amount

the amount to add, may be negative

result

the new date

FSCEXPEXT@1.1001:AddWeeks Permanent link for this heading

Adds a number of weeks to a date.
Note: Daylight saving time (DST) is not considered.
#DateUtils.AddWeeks(null, *)              = null
#DateUtils.AddWeeks(date, null)           = date
#DateUtils.AddWeeks(2002-03-28T13:45, 2)  = 2002-04-11T13:45
#DateUtils.AddWeeks(2002-03-28T13:45, -4) = 2002-02-28T13:45

datetime FSCEXPEXT@1.1001:AddWeeks(
  datetime dt,
  integer amount,
  out retval datetime result)

Name

Description

dt

the date

amount

the amount to add, may be negative

result

the new date

FSCEXPEXT@1.1001:AddYears Permanent link for this heading

Adds a number of years to a date.
Note: Daylight saving time (DST) is not considered.
#DateUtils.AddYears(null, *)              = null
#DateUtils.AddYears(date, null)           = date
#DateUtils.AddYears(2002-03-28T13:45, 2)  = 2004-03-28T13:45
#DateUtils.AddYears(2002-03-28T13:45, -2) = 2000-03-28T13:45

datetime FSCEXPEXT@1.1001:AddYears(
  datetime dt,
  integer amount,
  out retval datetime result)

Name

Description

dt

the date

amount

the amount to add, may be negative

result

the new date

FSCEXPEXT@1.1001:CountDays Permanent link for this heading

Counts the number of days between two dates.
Note: Daylight saving time (DST) is not considered.
#DateUtils.CountDays(null, *)                            = null
#DateUtils.CountDays(*, null)                            = null
#DateUtils.CountDays(2002-03-28T13:45, 2002-03-30T13:45) = 2
#DateUtils.CountDays(2002-03-28T13:45, 2002-04-11T13:45) = 14
#DateUtils.CountDays(2002-03-28T13:45, 2002-03-26T13:45) = -2
#DateUtils.CountDays(2002-03-28T13:45, 2002-02-28T13:45) = -28

integer FSCEXPEXT@1.1001:CountDays(
  datetime dt1,
  datetime dt2,
  out retval integer result)

Name

Description

dt1

the first date

dt2

the other date

result

the difference between the two dates.

FSCEXPEXT@1.1001:CountHours Permanent link for this heading

Counts the number of hours between two dates.
Note: Daylight saving time (DST) is not considered.
#DateUtils.CountHours(null, *)                            = null
#DateUtils.CountHours(*, null)                            = null
#DateUtils.CountHours(2002-03-28T13:45, 2002-03-28T15:45) = 2
#DateUtils.CountHours(2002-03-28T13:45, 2002-03-29T03:45) = 14
#DateUtils.CountHours(2002-03-28T13:45, 2002-03-28T11:45) = -2
#DateUtils.CountHours(2002-03-28T13:45, 2002-03-27T08:45) = -29

integer FSCEXPEXT@1.1001:CountHours(
  datetime dt1,
  datetime dt2,
  out retval integer result)

Name

Description

dt1

the first date

dt2

the other date

result

the difference between the two dates.

FSCEXPEXT@1.1001:CountMinutes Permanent link for this heading

Counts the number of minutes between two dates.
Note: Daylight saving time (DST) is not considered.
#DateUtils.CountMinutes(null, *)                            = null
#DateUtils.CountMinutes(*, null)                            = null
#DateUtils.CountMinutes(2002-03-28T13:45, 2002-03-28T13:47) = 2
#DateUtils.CountMinutes(2002-03-28T13:45, 2002-03-28T14:01) = 16
#DateUtils.CountMinutes(2002-03-28T13:45, 2002-03-28T13:43) = -2
#DateUtils.CountMinutes(2002-03-28T13:45, 2002-03-28T12:59) = -46

integer FSCEXPEXT@1.1001:CountMinutes(
  datetime dt1,
  datetime dt2,
  out retval integer result)

Name

Description

dt1

the first date

dt2

the other date

result

the difference between the two dates.

FSCEXPEXT@1.1001:CountMonths Permanent link for this heading

Counts the number of months between two dates.
Note: Daylight saving time (DST) is not considered.
#DateUtils.CountMonths(null, *)                            = null
#DateUtils.CountMonths(*, null)                            = null
#DateUtils.CountMonths(2002-03-28T13:45, 2002-05-28T13:45) = 2
#DateUtils.CountMonths(2002-03-28T13:45, 2003-05-28T13:45) = 14
#DateUtils.CountMonths(2002-03-28T13:45, 2002-01-28T13:45) = -2
#DateUtils.CountMonths(2002-03-28T13:45, 2001-01-28T13:45) = -14

integer FSCEXPEXT@1.1001:CountMonths(
  datetime dt1,
  datetime dt2,
  out retval integer result)

Name

Description

dt1

the first date

dt2

the other date

result

the difference between the two dates.

FSCEXPEXT@1.1001:CountSeconds Permanent link for this heading

Counts the number of seconds between two dates.
Note: Daylight saving time (DST) is not considered.
#DateUtils.CountSeconds(null, *)                               = null
#DateUtils.CountSeconds(*, null)                               = null
#DateUtils.CountSeconds(2002-03-28T13:45, 2002-03-28T13:45:02) = 2
#DateUtils.CountSeconds(2002-03-28T13:45, 2002-03-28T13:46:01) = 61
#DateUtils.CountSeconds(2002-03-28T13:45, 2002-03-28T13:44:58) = -2
#DateUtils.CountSeconds(2002-03-28T13:45, 2002-03-28T13:44:31) = -29

integer FSCEXPEXT@1.1001:CountSeconds(
  datetime dt1,
  datetime dt2,
  out retval integer result)

Name

Description

dt1

the first date

dt2

the other date

result

the difference between the two dates.

FSCEXPEXT@1.1001:CountWeeks Permanent link for this heading

Counts the number of weeks between two dates.
Note: Daylight saving time (DST) is not considered.
#DateUtils.CountWeeks(null, *)                            = null
#DateUtils.CountWeeks(*, null)                            = null
#DateUtils.CountWeeks(2002-03-28T13:45, 2002-04-11T13:45) = 2
#DateUtils.CountWeeks(2002-03-28T13:45, 2002-02-28T13:45) = -4

integer FSCEXPEXT@1.1001:CountWeeks(
  datetime dt1,
  datetime dt2,
  out retval integer result)

Name

Description

dt1

the first date

dt2

the other date

result

the difference between the two dates.

FSCEXPEXT@1.1001:CountYears Permanent link for this heading

Counts the number of years between two dates.
Note: Daylight saving time (DST) is not considered.
#DateUtils.CountYears(null, *)                            = null
#DateUtils.CountYears(*, null)                            = null
#DateUtils.CountYears(2002-03-28T13:45, 2004-03-28T13:45) = 2
#DateUtils.CountYears(2002-03-28T13:45, 2000-03-28T13:45) = -2

integer FSCEXPEXT@1.1001:CountYears(
  datetime dt1,
  datetime dt2,
  out retval integer result)

Name

Description

dt1

the first date

dt2

the other date

result

the difference between the two dates.

FSCEXPEXT@1.1001:DateCeiling Permanent link for this heading

Gets a date ceiling, leaving the field specified as the most significant field.
Note: Daylight saving time (DST) is not considered.
#DateUtils.DateCeiling(null, *)                        = null
#DateUtils.DateCeiling(date, null)                     = date
#DateUtils.DateCeiling(2002-03-28T13:45:01, DTO_HOUR)  = 2002-03-28T14:00:00
#DateUtils.DateCeiling(2002-03-28T13:45:01, DTO_MONTH) = 2002-04-01T00:00:00

datetime FSCEXPEXT@1.1001:DateCeiling(
  datetime dt,
  ModifyDateTimeOperand operand,
  out retval datetime result)

Name

Description

dt

the date

operand

the field specified

result

the result

FSCEXPEXT@1.1001:DateRound Permanent link for this heading

Rounds a date, leaving the field specified as the most significant field.
Note: Daylight saving time (DST) is not considered.
#DateUtils.DateRound(null, *)                        = null
#DateUtils.DateRound(date, null)                     = date
#DateUtils.DateRound(2002-03-28T13:45:01, DTO_HOUR)  = 2002-03-28T14:00:00
#DateUtils.DateRound(2002-03-28T13:45:01, DTO_MONTH) = 2002-04-01T00:00:00

datetime FSCEXPEXT@1.1001:DateRound(
  datetime dt,
  ModifyDateTimeOperand operand,
  out retval datetime result)

Name

Description

dt

the date

operand

the field specified

result

the result

FSCEXPEXT@1.1001:DateTruncate Permanent link for this heading

Truncates a date, leaving the field specified as the most significant field.
Note: Daylight saving time (DST) is not considered.
#DateUtils.DateTruncate(null, *)                        = null
#DateUtils.DateTruncate(date, null)                     = date
#DateUtils.DateTruncate(2002-03-28T13:45:01, DTO_HOUR)  = 2002-03-28T13:00:00
#DateUtils.DateTruncate(2002-03-28T13:45:01, DTO_MONTH) = 2002-03-01T00:00:00

datetime FSCEXPEXT@1.1001:DateTruncate(
  datetime dt,
  ModifyDateTimeOperand operand,
  out retval datetime result)

Name

Description

dt

the date

operand

the field specified

result

the result

FSCEXPEXT@1.1001:GetDayInWeek Permanent link for this heading

Determines the day in the week. Returns 0 for sunday, 1 for monday, ... up to 6 for saturday.
#DateUtils.GetDayInWeek(null)             = null
#DateUtils.GetDayInWeek(2002-03-28T13:45) = 4

integer FSCEXPEXT@1.1001:GetDayInWeek(
  datetime dt,
  out retval integer result)

Name

Description

dt

the date

result

the weekday (0 for sunday, 1 for monday, ... up to 6 for saturday)

FSCEXPEXT@1.1001:GetDayInYear Permanent link for this heading

Determines the day in the year. Returns 1 for Jan 1st upto 365/366.
#DateUtils.GetDayInYear(null)             = null
#DateUtils.GetDayInYear(2002-03-28T13:45) = 87

integer FSCEXPEXT@1.1001:GetDayInYear(
  datetime dt,
  out retval integer result)

Name

Description

dt

the date

result

the day in the year (1 is Jan 1st)

FSCEXPEXT@1.1001:IsSameDay Permanent link for this heading

Checks if two dates are on the same day ignoring time.
#DateUtils.IsSameDay(null, null)                         = false
#DateUtils.IsSameDay(null, *)                            = false
#DateUtils.IsSameDay(*, null)                            = false
#DateUtils.IsSameDay(2002-03-28T13:45, 2002-03-28T06:01) = true
#DateUtils.IsSameDay(2002-03-28T13:45, 2002-03-12T13:45) = false
#DateUtils.IsSameDay(2002-03-28T13:45, 2002-03-12)       = false

boolean FSCEXPEXT@1.1001:IsSameDay(
  datetime dt1,
  datetime dt2,
  out retval boolean result)

Name

Description

dt1

the first date

dt2

the other date

result

the boolean result

FSCEXPEXT@1.1001:TruncatedCompares Permanent link for this heading

Determines how two dates compare up to no more than the specified most significant field.

Returns -1, if the first date is less than the second date.
Returns 0, if the first date is equal to the second date.
Returns +1, if the first date is greater than the second date.

Note: Daylight saving time (DST) is not considered.
#DateUtils.TruncatedCompares(null, null, *)                                = null
#DateUtils.TruncatedCompares(null, *, *)                                   = null
#DateUtils.TruncatedCompares(*, null, *)                                   = null
#DateUtils.TruncatedCompares(2002-03-28T13:45, 2002-03-28T06:01, DTO_DAY)  = 0
#DateUtils.TruncatedCompares(2002-03-28T13:45, 2002-03-28T06:01, DTO_HOUR) = +1
#DateUtils.TruncatedCompares(2002-03-28T13:45, 2002-03-28T14:01, DTO_HOUR) = -1

integer FSCEXPEXT@1.1001:TruncatedCompares(
  datetime dt1,
  datetime dt2,
  ModifyDateTimeOperand operand,
  out retval integer result)

Name

Description

dt1

the first date

dt2

the other date

operand

compare up to the specified field

result

-1 if lower, 0 if equal and +1 if greater.

FSCEXPEXT@1.1001:TruncatedEquals Permanent link for this heading

Determines if two dates are equal up to no more than the specified most significant field.
Note: Daylight saving time (DST) is not considered.
#DateUtils.TruncatedEquals(null, null, *)                                = false
#DateUtils.TruncatedEquals(null, *, *)                                   = false
#DateUtils.TruncatedEquals(*, null, *)                                   = false
#DateUtils.TruncatedEquals(date1, date2, null)                           = date1 == date2
#DateUtils.TruncatedEquals(2002-03-28T13:45, 2002-03-28T06:01, DTO_DAY)  = true
#DateUtils.TruncatedEquals(2002-03-28T13:45, 2002-03-28T06:01, DTO_HOUR) = false
#DateUtils.TruncatedEquals(2002-03-28T13:45, 2002-03-28T13:01, DTO_HOUR) = true

boolean FSCEXPEXT@1.1001:TruncatedEquals(
  datetime dt1,
  datetime dt2,
  ModifyDateTimeOperand operand,
  out retval boolean result)

Name

Description

dt1

the first date

dt2

the other date

operand

the field specified

result

the boolean result