Date/Time Statements & Functions

 

 

Function

What It Does

Comments

Date = Date

Sets the current system date as specified in Date

For Windows 9x systems, Date must be a valid date between 1 Jan 80 and 31 Dec, 2099. For NT systems: between 1 Jan 80 and 31 Dec 2079

Date()

Returns a Variant that holds the current system date

 

DateAdd(interval, _

numbercode, oldDate)

Returns a new date after a value is added to a date

 

DateDiff(interval, _

date1, date2_

[,firstdayofweek]_[,firstweekofyear])

Returns a Variant that represents the difference between two dates.

interval returns a code that represents the time unit. firstdayofweekandfirstweekofyear are used to specify how the date should be calculated when certain codes are used

DatePart(interval, date_

[,firstdayofweek]_[,firstweekofyear])

Returns part (an element) from a given date.

interval returns a code that represents the time unit. firstdayofweek andfirstweekofyear are used to specify how the date should be calculated when certain codes are used

DateSerial(year, month, day)

Returns a Variant containing the internal representation of a date or time.

Year, month, and day are numeric values.

DateValue(stringDate)

Returns a Variant containing the internal representation of a date or time based on stringDate.

 

Day(date)

Returns a Variant which represents the conversion of date to a day number

Sunday is 1, Monday is 2, Tuesday is 3, etc.

Hour(time)

Returns a Variant of subtype Integer representing the hour (0-23) component of the time value specified by time.

 

Minute(time)

Returns a Variant representing the minute component (0-59) of the time value specified by time.

 

Month(date)

Returns a Variant representing the month number (1-12) component of date value specified by date.

 

Now()

Returns today s date as a Variant

 

Second(time)

Returns a Variant representing the second component (0-59) of the time value specified by time.

 

Time

Returns Variant containing the current system time.

 

Time = time

Sets the system time to the time specified by the time argument.

 

Timer

Returns Single representing the number of seconds that have elapsed since midnight.

 

TimeSerial(hour, minute, second)

Similar to DateSerial, only this one works on time

 

TimeValue(stringTimeExpression)

Similar to DateValue, only this one works on time.

 

Weekday (date,[firstdayofweek])

Returns, as a Variant, the number of the day of the week for the given date

If firstdayofweek is not specified, Sunday is 1, Monday is 2, Tuesday is 3, etc.

Year(date)

Returns a Variant which is the year for the value specified by date

 

Go Back to Top

arrowl2Return to the Visual Basic 6 Commands & Functions Page

Comments

 

Latest Version! NetObjects Fusion 10 

 

Copyright 1998 Rich Hamper 

All Rights Reserved

 

Last Updated:

Sunday, January 20, 2008