Interface IStdDateTimeModule
MS-VBAL 6.1.2.4 DateTime Module
public interface IStdDateTimeModule
Remarks
Formalizes the public interface of the standard library VBA.DateTime module.
Methods
StdDateTime__DateAdd(VBStringValue, VBDoubleValue, VBVariantValue)
MS-VBAL 6.1.2.4.1.1 DateAdd
RuntimeSemanticsEvaluationResult StdDateTime__DateAdd(VBStringValue interval, VBDoubleValue number, VBVariantValue date)
Parameters
intervalVBStringValueA string data value that specifies the interval of time to add.
numberVBDoubleValueThe number of intervals to add. Can be positive (future) or negative (past). Rounded to the nearest whole number if not an integral numeric value.
dateVBVariantValueA date data value to which the interval is added.
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Returns the result of adding or subtracting a specified time interval from a base date.
The valid interval parameter values are defined in IStdDateTimeModule.StdDateIntervals.
StdDateTime__DateDiff(VBStringValue, VBVariantValue, VBVariantValue, VBDayOfWeek, VBFirstWeekOfYear)
MS-VBAL 6.1.2.4.1.2 DateDiff
RuntimeSemanticsEvaluationResult StdDateTime__DateDiff(VBStringValue interval, VBVariantValue date1, VBVariantValue date2, VBDayOfWeek firstDayOfWeek = VBDayOfWeek.VBSunday, VBFirstWeekOfYear firstWeekofYear = VBFirstWeekOfYear.VBFirstJan1)
Parameters
intervalVBStringValueA string data value that specifies the interval of time to use to calculate the difference between
date1anddate2.date1VBVariantValueThe first date to use in the calculation.
date2VBVariantValueThe second date to use in the calculation.
firstDayOfWeekVBDayOfWeekA constant that specifies the first day of the week. This parameter is optional (default: VBSunday).
firstWeekofYearVBFirstWeekOfYearA constant that specifies the first week of the year. This parameter is optional (default: VBFirstJan1).
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Returns the result of adding or subtracting a specified time interval from a base date.
StdDateTime__DatePart(VBStringValue, VBVariantValue, VBVariantValue, VBDayOfWeek, VBFirstWeekOfYear)
MS-VBAL 6.1.2.4.1.3 DatePart
RuntimeSemanticsEvaluationResult StdDateTime__DatePart(VBStringValue interval, VBVariantValue date1, VBVariantValue date2, VBDayOfWeek firstDayOfWeek = VBDayOfWeek.VBSunday, VBFirstWeekOfYear firstWeekofYear = VBFirstWeekOfYear.VBFirstJan1)
Parameters
intervalVBStringValueA string data value that specifies the interval of time to use to calculate the difference between
date1anddate2.date1VBVariantValueThe first date to use in the calculation.
date2VBVariantValueThe second date to use in the calculation.
firstDayOfWeekVBDayOfWeekA constant that specifies the first day of the week. This parameter is optional (default: VBSunday).
firstWeekofYearVBFirstWeekOfYearA constant that specifies the first week of the year. This parameter is optional (default: VBFirstJan1).
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Returns the result of adding or subtracting a specified time interval from a base date.
StdDateTime__DateSerial(VBIntegerValue, VBIntegerValue, VBIntegerValue)
MS-VBAL 6.1.2.4.1.4 DateSerial
RuntimeSemanticsEvaluationResult StdDateTime__DateSerial(VBIntegerValue year, VBIntegerValue month, VBIntegerValue day)
Parameters
yearVBIntegerValueA VBIntegerValue representing the year of the date value.
monthVBIntegerValueA VBIntegerValue representing the month of the date value.
dayVBIntegerValueA VBIntegerValue representing the day of the date value.
Returns
Remarks
Returns a VBDateValue from a specified year, month, and day.
StdDateTime__DateValue(VBVariantValue)
MS-VBAL 6.1.2.4.1.5 DateValue
RuntimeSemanticsEvaluationResult StdDateTime__DateValue(VBVariantValue date)
Parameters
dateVBVariantValueA value that is let-coercible to a VBDateValue, holding a date value to be represented.
Returns
Remarks
Returns a VBDateValue from a specified VBStringValue.
StdDateTime__Day(VBVariantValue)
MS-VBAL 6.1.2.4.1.6 Day
RuntimeSemanticsEvaluationResult StdDateTime__Day(VBVariantValue date)
Parameters
dateVBVariantValueA value that is let-coercible to a VBDateValue, holding a date value to be represented.
Returns
Remarks
Returns a VBVariantValue/VBIntegerValue representing the day of the month.
StdDateTime__Hour(VBVariantValue)
MS-VBAL 6.1.2.4.1.7 Hour
RuntimeSemanticsEvaluationResult StdDateTime__Hour(VBVariantValue time)
Parameters
timeVBVariantValueA value that is let-coercible to a VBDateValue, holding a date value to be represented.
Returns
Remarks
Returns a VBVariantValue/VBIntegerValue between 0 and 23 representing the hour of the day.
StdDateTime__Minute(VBVariantValue)
MS-VBAL 6.1.2.4.1.8 Minute
RuntimeSemanticsEvaluationResult StdDateTime__Minute(VBVariantValue time)
Parameters
timeVBVariantValueA value that is let-coercible to a VBDateValue, holding a date value to be represented.
Returns
Remarks
Returns a VBVariantValue/VBIntegerValue between 0 and 59 representing the minute of the hour.
StdDateTime__Month(VBVariantValue)
MS-VBAL 6.1.2.4.1.9 Month
RuntimeSemanticsEvaluationResult StdDateTime__Month(VBVariantValue date)
Parameters
dateVBVariantValueA value that is let-coercible to a VBDateValue, holding a date value to be represented.
Returns
Remarks
Returns a VBVariantValue/VBIntegerValue between 1 and 12 representing the month of the year.
StdDateTime__Second(VBVariantValue)
MS-VBAL 6.1.2.4.1.10 Second
RuntimeSemanticsEvaluationResult StdDateTime__Second(VBVariantValue time)
Parameters
timeVBVariantValueA value that is let-coercible to a VBDateValue, holding a date value to be represented.
Returns
Remarks
Returns a VBVariantValue/VBIntegerValue between 0 and 59 representing the second of the minute.
StdDateTime__TimeSerial(VBIntegerValue, VBIntegerValue, VBIntegerValue)
MS-VBAL 6.1.2.4.1.11 TimeSerial
RuntimeSemanticsEvaluationResult StdDateTime__TimeSerial(VBIntegerValue hour, VBIntegerValue minute, VBIntegerValue second)
Parameters
hourVBIntegerValueAn integer between 0 and 23 representing the hour of the day.
minuteVBIntegerValueAn integer between 0 and 59 representing the minute of the hour.
secondVBIntegerValueAn integer between 0 and 59 representing the second of the minute.
Returns
Remarks
Returns a VBVariantValue holding a date containing the time for a specific hour, minute, and second.
StdDateTime__TimeValue(VBStringValue)
MS-VBAL 6.1.2.4.1.12 TimeValue
RuntimeSemanticsEvaluationResult StdDateTime__TimeValue(VBStringValue time)
Parameters
timeVBStringValueA time value to be represented.
Returns
Remarks
Returns a VBVariantValue (VBDateValue) truncated of its date portion.
StdDateTime__WeekDay(VBVariantValue, VBDayOfWeek)
MS-VBAL 6.1.2.4.1.13 WeekDay
RuntimeSemanticsEvaluationResult StdDateTime__WeekDay(VBVariantValue date, VBDayOfWeek firstDayOfWeek = VBDayOfWeek.VBSunday)
Parameters
dateVBVariantValueA value that is let-coercibleto a VBDateValue.
firstDayOfWeekVBDayOfWeekA constant that specifies the first day of the week. This parameter is optional (default: VBSunday).
Returns
Remarks
Returns an VBVariantValue (VBIntegerValue) representing the day of the week of a specified VBDateValue.
StdDateTime__Year(VBVariantValue)
MS-VBAL 6.1.2.4.1.14 Year
RuntimeSemanticsEvaluationResult StdDateTime__Year(VBVariantValue date)
Parameters
dateVBVariantValueA value that is let-coercible to a VBDateValue, holding a date value to be represented.
Returns
Remarks
Returns a VBVariantValue/VBIntegerValue representing the year.
StdDateTime__getCalendar()
MS-VBAL 6.1.2.4.2.1 Calendar
RuntimeSemanticsEvaluationResult StdDateTime__getCalendar()
Returns
Remarks
Gets or sets the VBCalendar to use for subsequent calls to VBA.DateTime module functions.
StdDateTime__getDate()
MS-VBAL 6.1.2.4.2.2 Date
RuntimeSemanticsEvaluationResult StdDateTime__getDate()
Returns
Remarks
Gets a VBVariantValue (VBDateValue) holding the current system date.
StdDateTime__getDateStr()
MS-VBAL 6.1.2.4.2.2 Date$
RuntimeSemanticsEvaluationResult StdDateTime__getDateStr()
Returns
Remarks
Gets a VBStringValue holding a string representation of the current system date.
StdDateTime__getNow()
MS-VBAL 6.1.2.4.2.3 Now
RuntimeSemanticsEvaluationResult StdDateTime__getNow()
Returns
Remarks
Gets a VBDateValue holding the current system date and time.
StdDateTime__getTime()
MS-VBAL 6.1.2.4.2.4 Time
RuntimeSemanticsEvaluationResult StdDateTime__getTime()
Returns
Remarks
Gets a VBVariantValue (VBDateValue) holding the current system time.
StdDateTime__getTimeStr()
MS-VBAL 6.1.2.4.2.4 Time$
RuntimeSemanticsEvaluationResult StdDateTime__getTimeStr()
Returns
Remarks
Gets a VBStringValue holding a string representation of the current system time.
StdDateTime__getTimer()
MS-VBAL 6.1.2.4.2.5 Timer
RuntimeSemanticsEvaluationResult StdDateTime__getTimer()
Returns
Remarks
Gets a VBSingleValue representing the number of seconds elapsed since midnight.
👉 The sub-second resolution is implementation-dependant; MS-VBAL resolution measures ticks (15ms).
StdDateTime__setCalendar(VBCalendar)
MS-VBAL 6.1.2.4.2.1 Calendar
RuntimeSemanticsEvaluationResult StdDateTime__setCalendar(VBCalendar value)
Parameters
valueVBCalendar
Returns
Remarks
Gets or sets the VBCalendar to use for subsequent calls to VBA.DateTime module functions.