在ASP.NET中处理 datetime 的一些通用函数(vb)
来源:互联网 发布:在淘宝买药可靠吗 编辑:程序博客网 时间:2024/06/05 19:56
在ASP.NET中处理 datetime 的一些通用函数(vb)
'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
- 在ASP.NET中处理 datetime 的一些通用函数(vb)
- 在ASP.NET中处理datetime的一些通用函数(VB)
- 在ASP.NET中处理 datetime 的一些通用函数(vb)
- 在ASP.NET中处理 datetime 的一些通用函数(vb)
- 在ASP.NET中处理 datetime 的一些通用函数(vb)
- 在ASP.NET中处理 datetime 的一些通用函数(vb)
- ASP.NET中处理datetime的一些通用函数
- ASP.NET中处理datetime的一些通用函数
- ASP.NET中处理datetime的一些通用函数
- asp.net中System.DateTime.Now.ToString()的一些用法
- asp.net中System.DateTime.Now.ToString()的一些用法
- asp.net中System.DateTime.Now.ToString()的一些用法
- asp.net中System.DateTime.Now.ToString()的一些用法
- asp.net中System.DateTime.Now.ToString()的一些用法
- asp.net中System.DateTime.Now.ToString()的一些用法
- asp.net中System.DateTime.Now.ToString()的一些用法
- asp.net中System.DateTime.Now.ToString()的一些用法
- asp.net中System.DateTime.Now.ToString()的一些用法
- 模块管理常规功能自定义系统的设计与实现(03--基本系统)
- 语言随记3
- 在Asp.Net中从sqlserver检索(retrieve)图片
- php正则中文
- Cocos2d-x 屏幕适配新解 分享2
- 在ASP.NET中处理 datetime 的一些通用函数(vb)
- HashMap和Hashtable的区别
- js上传图片预览加实时剪切
- SQL Server安装程序无法获取ASPNET账户的系统账户信息
- JS正则表达式大全
- html 1.1
- 存储数据键和项目对的类(Dictionary对象)
- 如何用UIBezierPath画线
- 今天的收获