📜  VBScript-日期和时间函数

📅  最后修改于: 2020-10-19 04:09:14             🧑  作者: Mango


VBScript日期和时间函数可帮助开发人员将日期和时间从一种格式转换为另一种格式,或以适合特定条件的格式表示日期或时间值。

日期功能

Function Description
Date A Function, which returns the current system date
CDate A Function, which converts a given input to Date
DateAdd A Function, which returns a date to which a specified time interval has been added
DateDiff A Function, which returns the difference between two time period
DatePart A Function, which returns a specified part of the given input date value
DateSerial A Function, which returns a valid date for the given year,month and date
FormatDateTime A Function, which formats the date based on the supplied parameters
IsDate A Function, which returns a Boolean Value whether or not the supplied parameter is a date
Day A Function, which returns an integer between 1 and 31 that represents the day of the specified Date
Month A Function, which returns an integer between 1 and 12 that represents the month of the specified Date
Year A Function, which returns an integer that represents the year of the specified Date
MonthName A Function, which returns Name of the particular month for the specified date
WeekDay A Function, which returns an integer(1 to 7) that represents the day of the week for the specified day.
WeekDayName A Function, which returns the weekday name for the specified day.

时间功能

Function Description
Now A Function, which returns the current system date and Time
Hour A Function, which returns and integer between 0 and 23 that represents the Hour part of the the given time
Minute A Function, which returns and integer between 0 and 59 that represents the Minutes part of the the given time
Second A Function, which returns and integer between 0 and 59 that represents the Seconds part of the the given time
Time A Function, which returns the current system time
Timer A Function, which returns the number of seconds and milliseconds since 12:00 AM
TimeSerial A Function, which returns the time for the specific input of hour,minute and second
TimeValue A Function, which converts the input string to a time format