Recommended: Optimization of ASP pagination effect When learning ASP, the essential thing is to use four major operations: adding, deleting, modifying and checking. The most troublesome thing is to output the data in the database to the client. When there is very little data, for example, there are a few pieces in a database, so you can output it directly. But if there is a lot of data
Function syntax description example
Now Now() Get the current date and time of the system Dim MyVar MyVar = Now
'' MyVar contains the current date and time.
Date Date() Get the current date of the system Dim MyDate MyDate = Date
'' MyDate contains the current system date.
Time Time() Get the current time of the system Dim MyTime MyTime = Time
'' Return to the current system time.
Year Year(Date) Gets the year for the given date Dim MyDate, MyYear
MyDate = #October 19, 1962#
Function syntax description example
Now Now() Get the current date and time of the system Dim MyVar MyVar = Now
'' MyVar contains the current date and time.
Date Date() Get the current date of the system Dim MyDate MyDate = Date
'' MyDate contains the current system date.
Time Time() Get the current time of the system Dim MyTime MyTime = Time
'' Return to the current system time.
Year Year(Date) Gets the year for the given date Dim MyDate, MyYear
MyDate = #October 19, 1962#
''Distributed one date.
MyYear = Year(MyDate)
'' MyYear contains 1962.
Month Month(Date) Gets the month of the given date Dim MyVar MyVar = Month(Now)
'' MyVar contains the number corresponding to the current month.
Day Day(Date) Get what is the given date Dim MyDay MyDay = Day(October 19, 1962)
''MyDay contains 19.
Hour Hour(time) Dim MyTime, MyHour
MyTime = Now MyHour = Hour(MyTime)
'' MyHour contains the value representing the current time.
Minute Minute(time) How much is the given time Dim MyVar
MyVar = Minute(Now)
Second Second(time) Dim MySec
MySec = Second(Now)
''MySec contains the number representing the current second.
WeekDay WeekDay(Date) Gets an integer whose given date is the day of the week, 1 represents Sunday, 2 represents Monday, and so on Dim MyDate, MyWeekDay
MyDate = #October 19, 1962#
'' Distribution date
MyWeekDay = Weekday(MyDate)
'' MyWeekDay contains 6, MyDate represents Friday
DateDiff DateDiff(Var,Var1,Var2)
Var: Date or time interval factor, with the following parameters:
yyyy year m month d day ww week h hour s second Var1: first date or time
Var2: The second date or time, calculate the interval between two dates or time later than Var1 DateDiff(d,Date(),#1/1/2005#)
''How many are there to go before New Year's Day 2005
DateDiff(h,Date(),#1/1/2005#)
''How many hours are there to go back to New Year's Day 2005
DateDiff(d,#1/1/2003#,#1/1/2005#)
''Returns the number of days between two dates
DateAdd DateDiff(Var,Var1,Var2)
Var: Date or time interval factor:
Var1: Date or time interval multiple
Var2: The reference of date or time adds two date or time to the following example adds January 31, 1995 to one month:
NewDate = DateAdd(m, 1, 31-Jan-95)
In this example, DateAdd returns February 28, 95, instead of February 31, 95. If date is January 31, 2019, it returns February 29, 2019, because 1996 is a leap year.
An error occurs if the calculated date is before 100 AD.
FormatDateTime FormatDateTime(Date,vbShortDate) Convert to short date format FromatDateTime(Date(),vbLongDate)
Displayed in long date format
FormatDateTime(Date,vbLongDate) is converted to long date format
FormatDateTime(Date,vbShortTime) is converted to short-time format
FormatDateTime(Date,vbLongTime) is converted to long-term format
Share: What is the difference between ASP and ASP In previous articles we recognized that ASP is part of a complete operating system. But why is ASP different from previous versions of ASP? What is the difference between them? If you're just running some pages or applications, you probably won't notice it at all