<< Click to Display Table of Contents >> Navigation: FindOnClick > FindOnClick For Advanced Users > Scripting > Functions > Dates and Times |
function YearOf(Date);
Date: The date to return the year of
Return value: The year of the date given, e.g. 2020
function MonthOf(Date);
function MonthOfTheYear(Date);
Date: The date to return the month of (for the year)
Return value: The month of the date given, ranging from1 to 12, e.g. 1 if it is January
function WeekOf(Date);
function WeekOfTheYear(Date);
Date: The date & time to return the week of (for the year)
Return value: The week of the date given, for that year, ranging from 1 to 53. WeekOf uses the ISO 8601 standard to define the week of the year. That is, a week is defined as running from Monday through Sunday, and the first week of the year is the one that includes the first Thursday of the year (the first week that includes four or more days in the year). This means that if the first calendar day of the year is a Friday, Saturday, or Sunday, then for the first three, two, or one days of the calendar year, WeekOf returns the last week of the previous year. Similarly, if the last calendar day of the year is a Monday, Tuesday, or Wednesday, then for the last one, two, or three days of the calendar year, WeekOf returns 1 (the first week of the next calendar year).
function WeekOfTheMonth(Date);
Date: The date & time to return the week of (for the month)
Return value: The week of the date given, for that month, ranging from 1 to 6. WeekOfTheMonth uses the ISO 8601 standard definition of a week. That is, a week is considered to start on a Monday and end on a Sunday.
function DayOf(Date);
function DayOfTheMonth(Date);
Date: The date to return the day of (for the month)
Return value: The day of the month, ranging from 1 to 31.
function DayOfTheWeek(Date);
Date: The date to return the day of (for the week)
Return value: The day of the week, ranging from 1 (Monday) to 7 (Sunday). DayOfTheWeek is ISO 8601 compliant (where Monday is considered the first day of the week).
function DayOfTheYear(Date);
Date: The date to return the day of (for the year)
Return value: Returns the number of days between a specified Date and December 31 of the previous year. For example, a Date value that refers to January 1 generates a result of 1, dates on January 2 return 2, dates on February 1 return 32, and so on.
function HourOf(Time);
Time: The time to return the hour of (for the day)
Return value: The hour, ranging from 0 to 23.
function MinuteOf(Time);
Time: The time to return the minute of (for the hour)
Return value: The minute, ranging from 0 to 59.
function SecondOf(Time);
Time: The time to return the second of (for the minute)
Return value: The second, ranging from 0 to 59.
function MilliSecondOf(Time);
Time: The time to return the milli-second of (for the second)
Return value: The milli-second, ranging from 0 to 999.
function DateOf(DateTime);
Time: The date & time to return the date
Return value: This functions takes the time off so just the date is returned.
function TimeOf(DateTime);
DateTime: The date & time to return the time of
Return value: This functions takes the date off so just the time is returned.
function Today;
Return value: Today's date (no time).
Alternatively, you can use Now to get the current date & time.
function Yesterday;
Return value: Yesterdays date (no time)..
function Tomorrow;
Return value: Tomorrows date (no time)..
function EncodeDateTime(Year,Month,Day,Hour,Minute,Second,Millisecond);
Year: The year, e.g. 2020
Month: The month of the year, e.g. 12 (for December)
Day: The day of the month, e.g. 25
Hour: The hour (0-23)
Minute: The minute of the hour (0-59)
Second: The second of the minute (0-59)
MilliSecond: The milli-second of the second (0-999)
Return value: The date & time.
procedure DecodeDateTime(DateTime,var Year,var Month,var Day,var Hour,var Minute,var Second,var Millisecond);
DateTime: The date & time to decode
Year: Set to the year, e.g. 2020
Month: Set to the month of the year, e.g. 12 (for December)
Day: Set to the day of the month, e.g. 25
Hour: Set to the hour (0-23)
Minute: Set to the minute of the hour (0-59)
Second: Set to the second of the minute (0-59)
MilliSecond: Set to the milli-second of the second (0-999)
function SameDate(Date1, Date2);
Date1: The date to compare with Date2
Date2: The date to compare with Date1
Return value: TRUE if the dates are the same.
function SameTime(Time1, Time2);
Time1: The time to compare with Time2
Time2: The time to compare with Time1
Return value: TRUE if the times are the same.
function SameDateTime(DateTime1, DateTime2);
DateTime1: The date & time to compare with DateTime2
DateTime2: The date & time to compare with DateTime1
Return value: TRUE if the dates & times are the same.
function CompareDate(Date1, Date2);
Date1: The date to compare with Date2
Date2: The date to compare with Date1
Return value: LessThanValue if Date1 is before Date2, EqualsValue if Date1 and Date2 are the same day or GreaterThanValue if Date1 is after Date2.
function CompareTime(Time1, Time2);
Time1: The time to compare with Time2
Time2: The time to compare with Time1
Return value: LessThanValue if Time1 is before Time2, EqualsValue if Time1 and Time2 are the same time or GreaterThanValue if Time1 is after Time2.
function CompareDateTime(DateTime1, DateTime2);
DateTime1: The date & time to compare with DateTime2
DateTime2: The date & time to compare with DateTime1
Return value: LessThanValue if DateTime1 is before DateTime2, EqualsValue if DateTime1 and DateTime2 are the same date & time or GreaterThanValue if DateTime1 is after DateTime2.
<%SBCOPYRIGHT%>