六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

ASP.NET中處理datetime的一些通用函數

[摘要]'Uses the Timespan method to subtract a certain number of daysFunction Date1() Dim NewTime ...
'Uses the Timespan method to subtract a certain number of days
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

'Uses the AddDays method to subtract X number of days
Public Function Date2()
  Dim NewTime as DateTime
  NewTime = DateTime.Now.AddDays(-7)
  Dim s as string = NewTime
  return s
End Function

'Thanks to Paul Czywczynski for this idea
'This probably (In My opinion) Offers the most flexibility found so far
'Change where the MM/dd/yyyy to whatever
'response.write(System.String.Format("{0:d}",NewTime))
'would return just the name of the Day
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

'Uses the toLongTimeString method
Public Function Date5()
  Dim NewTime as DateTime
  NewTime = Now()
  return newtime.toLongTimeString()
End Function

'Uses the toShortTimeString method
Public Function Date6()
  Dim NewTime as DateTime
  NewTime = Now()
  return newtime.toShortTimeString()
End Function

'Uses the toLongDateString method
Public Function Date7()
  Dim NewTime as DateTime
  NewTime = Now()
  return newtime.toLongDateString()
End Function

'Uses the toShortDateString method
Public Function Date8()
  Dim NewTime as DateTime
  NewTime = Now()
  return newtime.toShortDatestring()
End Function

'Uses FormatDateTime function General format
Function Date9()
  Dim NewTime as DateTime
  NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
  return formatdatetime(NewTime, 0)
End Function

'Uses FormatDateTime function LongDate format
Function Date10()
  Dim NewTime as DateTime
  NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
  return formatdatetime(NewTime, 1)
End Function

'Uses FormatDateTime function ShortDate format
Function Date11()
  Dim NewTime as DateTime
  NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
  return formatdatetime(NewTime, 2)
End Function

'Uses FormatDateTime function LongTime format
Function Date12()
  Dim NewTime as DateTime
  NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
  return formatdatetime(NewTime, 3)
End Function

'Uses FormatDateTime function ShortTime format
Function Date13()
  Dim NewTime as DateTime
  NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
  return formatdatetime(NewTime, 4)
End Function

'Bring Back just the name of the Day
Function Date14()
  Dim NewTime as DateTime = now.addDays(-7)
  dim s as string
  s = (System.String.Format("{0:dddd}",NewTime))
  Return s
End Function

'Returns the Integer of what day of week
Function Date15()
  Dim MyDate as DateTime
  Dim MyWeekDay as Integer
  MyDate = Now.AddDays(-5)
  MyWeekDay = Weekday(MyDate)   
  return MyWeekDay
End Function

'Returns the Month Integer
Function Date16()
  Dim MyDate as DateTime
  Dim MyMonth as Integer
  MyDate = Now.AddDays(-5)
  MyMonth = Month(MyDate)   
  return MyMonth
End Function

'Returns just a formatted string
'This method provides just formatting but
'Very flexible with not a lot of code
Function Date17()
  Dim MyDate as String
  MyDate = Format(Now(), "yyyy")
  return MyDate
End Function
</script>




主站蜘蛛池模板: 亚欧在线精品免费观看一区 | 手机福利视频一区二区 | 亚洲欧美日韩综合久久久久 | 色综合久久网 | 青青草视频免费看 | 亚洲一欧洲中文字幕在线 | 欧美一区二区aa大片 | 日韩欧美一卡二区 | 人人cao| 青青草原免费在线观看视频 | 亚洲国产精品综合欧美 | 人人干夜夜操 | 午夜免费啪啪 | 欧美一级爽快片淫片高清在线观看 | 一级欧美| 亚洲日韩精品欧美一区二区 | 涩涩99| 日本一区二区视频在线观看 | 日本xx高清视频免费观看 | 野草影院手机在线观看免费6 | 一区小说二区另类小说三区图 | 色综合久久天天综合绕观看 | 在线观看视频h | 碰91精品国产91久久婷婷 | 一二三四视频日本高清 | 在线观看日本 | 日韩不卡免费视频 | 亚洲乱码在线视频 | 四虎影院免费观看视频 | 亚洲第一精品夜夜躁人人爽 | 最近最新中文字幕在线第一页 | 亚洲成人xxx| 亚洲 欧美 精品专区 极品 | 天天影视色香欲性综合网网站 | 亚欧乱色一区二区三区 | 亚洲第一区精品日韩在线播放 | 亚洲乱码一二三四区国产 | 日韩欧美综合在线二区三区 | 小明www永久在线看 小黄鸭b站视频在线 | 天天射日日操 | 色又色 |