共用方式為


DateAndTime Module (Visual Basic) 

The DateAndTime module contains the procedures and properties used in date and time operations.

Remarks

This module supports the Visual Basic language keywords and run-time library members that get the current date or time, perform date calculations, return a date or time, set the date or time, or time the duration of a process.

Members

DateAdd

DateDiff

DatePart

DateSerial

DateString

DateValue

Day

Hour

Minute

Month

MonthName

Now

Second

TimeOfDay

Timer

TimeSerial

TimeString

TimeValue

Today

WeekDay

WeekDayName

Year

 

 

Example

This example uses the Today property to return the current system date.

Dim thisDate As Date
thisDate = Today 

See Also

Reference

Dates and Times Summary
Keywords and Members by Task
Visual Basic Language Keywords
Visual Basic Run-Time Library Members
Keywords Compared in Different Languages