Function
|
Signature
|
Meaning
|
Availability
|
---|---|---|---|
countryCode
|
String countryCode(String country)
|
Gets the ISO 3166 2-letter country code for the specified country code or English country name.
|
Codebeamer 7.8 and later
|
Date
|
Date Date(String date[, String timezone])
|
Creates a date according to the passed argument (and timezone).
|
Codebeamer 9.5 and later
|
isSameDay
|
boolean isSameDay(Date date1, Date date2)
|
Returns true if both dates are within the same calendar day. This is equivalent to inSamePeriod(date1, date2, day).
|
Codebeamer 9.3 and later
|
inSamePeriod
|
boolean inSamePeriod(Date date1, Date date2, String period)
|
Returns true if both dates are within the same calendar period, that is, Year, Month, Day and so on. For example, inSamePeriod(Date(2019-01-01 00:00), Date(2019-01-01 12:00, period) returns true for Y(ear), M(onth) and d (ay) and false for any other period.
|
Codebeamer 5.4 and later
|
roundDate
|
Date roundDate(Date date, String precision)
|
Rounds a date according to the specified precision.
|
Codebeamer 5.4 and later
|
shiftDate
|
Date shiftDate(Date date, int distance, String unit)
|
Shifts a date by the specified distance in the specified unit (see below). To shift by net working time, you must use scrollWorkTime (CB-9.3 and later) instead.
|
Codebeamer 5.4 and later
|
timeBetween
|
Long timeBetween(Date date1, Date date2, String unit)
|
Returns the time between two dates in the specified unit (see below), based on 7 days per week, 24 hours per day, 60 minutes per hour and 60 seconds per minute. To get the net working time between two dates, you must use workTimeBetween (CB-9.3 and later) instead. The result can be negative, if date1 is after date2. For example, timeBetween(Date(2018-12-31), Date(2019-01-01, Year) returns 0, because the difference between the two dates is less than a year. It's also less than a month or a week. But it is 1 d(ay(s)), 24 h(our(s)), 1440 m(in(ute(s))) or 86400 s(ec(ond(s))).
|
Codebeamer 9.3 and later
|
truncateDate
|
Date truncateDate(Date date, String precision)
|
Truncates a date according to the specified precision.
|
Codebeamer 5.4 and later
|