One. Operations of various time decrease
Take a certain number of days by time interval
Function date1 ()
DIM NewTime As datetime
NewTime = datetime.now.subtract (New TimeSpan (7, 0, 0, 0)))
NEWTIME = NewTIME.FORMAT ("mm / dd / yyyy", datetimeformatinfo)
Response.write (NewTime)
END FUNCTION
Use the number of wealth days to minus a certain number of days
Public function date2 ()
DIM NewTime As datetime
Newtime = datetime.now.adddays (-7)
DIM S as string = newTIME
Return S
END FUNCTION
Return date name string
Function date3 ()
Dim newtime as datetime = now.adddays (-7)
Response.write (System.String.Format ("{0: mm / dd / yyyy}", newtime))
END FUNCTION
Function date4 ()
DIM NewTime As datetime
NEWTIME = now.adddays (-7)
Return newTime.toString ()
END FUNCTION
Long-term mode
Public function date5 ()
DIM NewTime As datetime
NEWTIME = now ()
Return newTime.tolongTimeString ()
END FUNCTION
Use short time mode
Public function date6 ()
DIM NewTime As datetime
NEWTIME = now ()
Return newtime.toshorttimeString ()
END FUNCTION
Long date mode
Public function date7 ()
DIM NewTime As datetime
NEWTIME = now ()
Return newtime.tolongdateString ()
END FUNCTION
Use a short day mode
Public function date8 ()
DIM NewTime As datetime
NEWTIME = now ()
Return newtime.toshortdateString ()
END FUNCTION
Format date function
Format into generic format
Function date9 ()
DIM NewTime As datetime
NewTime = datetime.now.subtract (New TimeSpan (7, 0, 0, 0)))
Return Formator (NewTime, 0)
END FUNCTION
Format growth date format
Function date10 ()
DIM NewTime As datetime
NewTime = datetime.now.subtract (New TimeSpan (7, 0, 0, 0)))
Return Formator (NewTime, 1)
END FUNCTION
Format into short date format
Function Date11 ()
DIM NewTime As datetime
NewTime = datetime.now.subtract (New TimeSpan (7, 0, 0, 0)))
Return Formator (NewTIME, 2)
END FUNCTION
Format growth time format
Function Date12 ()
DIM NewTime As datetime
NewTime = datetime.now.subtract (New TimeSpan (7, 0, 0, 0)))
Return Formator (NewTime, 3)
END FUNCTION
Format into short time format
Function Date13 ()
DIM NewTime As datetime
NewTime = datetime.now.subtract (New TimeSpan (7, 0, 0, 0)))
Return Formator (NewTIME, 4)
END FUNCTION
Single display time, month, day, etc.
Date display
Function Date14 ()
Dim newtime as datetime = now.adddays (-7)
DIM S As String
s = (System.String.Format ("{0: DDDD}", NewTime))
Return S
END FUNCTION
The first few days of the week of the return date
Function date15 ()
DIM MyDate as datetime
Dim myweekday as integer
Mydate = now.adddays (-5)
Myweekday = weekday (mydate)
Return myweekday
END FUNCTION
Return the month value
Function date16 ()
DIM MyDate as datetime
DIM MyMonth As INTEGER
Mydate = now.adddays (-5)
Mymonth = month (MyDate)
Return mymonth
END FUNCTION
Returns a formatted string
Function date17 ()
DIM MyDate as string
Mydate = format (now (), "YYYY")
Return mydate
END FUNCTION
script>