Date
DateDiff()
Syntax: DateDiff(Interval as String, Date1 as Date, Date2 as Date, Optional DayOfWeek, Optional WeekOfYear) as Long
Parameters:
Interval - There are 10 different types of intervals. Depending on the interval the DateDiff() well return the number of units in the Interval. Below is a list of the 10 items. In the script below I used constants to better define them.
Parameter |
DateSerial()
Brian Element
Syntax: DateSerial(Year as integer, Month as integer, Day as integer) The DateSerial function creates a Date value from separate month, day, and year values.
DateValue()
Brian Element
Syntax: DateValue(StringDate as String) as Date The DateValue function assignes a specific data to a type Date variable. Converting a string representation of a date into a Date value. Parameters: The StringDate can be different date formats in string, the following are a few examples:
Now()
Brian Element
Returns the system date and time as a type Date.
Date()
Brian Element
Returns the system date (no time information).
Time()
Brian Element
Returns the current system time (no date information).
TimeValue()
Brian Element
Use the TimeValue function to create time values for type Date variables.
TimeSerial
Brian Element
Use the TimeSerial function to create time values for type Date variables. For TimeSerial, the values are normally in the range 0 to 23 for hours, and 0 to 59 for minutes and seconds. Larger values wrap to the next larger unit; therefore, a seconds value of 90 corresponds to one minute and 30 seconds
Day()
Brian Element
Syntax: Day(DateValue as Date) as integer Day(date) Returns a value 1–31 representing the day of the month Parameter: The DateValue must be a valid date.
Hour()
Brian Element
Hour(date) Returns a value 0–23 representing the hour of the day
|