大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
Dim ThisDay As String = Format(Now, "yyyy-MM-dd") '获得当前日期字符串
为吉安等地区用户提供了全套网页设计制作服务,及吉安网站建设行业解决方案。主营业务为网站设计制作、做网站、吉安网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!
Dim ThisDateTime As DateTime = Convert.ToDateTime(ThisDay) '当前日期转换成DateTime
Dim ThisWeekDay As Integer = ThisDateTime.DayOfWeek '获得当前日期是星期几
Dim differadd As Integer = 1 - ThisWeekDay '相差的天数(星期1与当前星期几相差的天数)
Dim MyAdd As New TimeSpan(differadd, 0, 0, 0)
Dim MyYear As Integer = Format(Now, "yyyy") '获取当前日期的年份
Dim MyMonth As Integer = Format(Now, "MM") '获取当前日期的月份
Dim MyDay As Integer = Format(Now, "dd") '获取当前日期是几号
Dim MyToday As DateTime = New DateTime(MyYear, MyMonth, MyDay)
Dim Yourday As DateTime = MyToday.Add(MyAdd)
MsgBox("本周星期一的日期是:" Yourday)
Dim ThisDay As String = Format(Now, "yyyy-MM-dd") '获得当前日期字符串
Dim ThisDateTime As DateTime = Convert.ToDateTime(ThisDay) '当前日期转换成DateTime
Dim ThisWeekDay As Integer = ThisDateTime.DayOfWeek '获得当前日期是星期几
Dim differadd As Integer = 1 - ThisWeekDay '相差的天数(星期1与当前星期几相差的天数)
Dim MyAdd As New TimeSpan(differadd, 0, 0, 0)
Dim MyYear As Integer = Format(Now, "yyyy") '获取当前日期的年份
Dim MyMonth As Integer = Format(Now, "MM") '获取当前日期的月份
Dim MyDay As Integer = Format(Now, "dd") '获取当前日期是几号
Dim MyToday As DateTime = New DateTime(MyYear, MyMonth, MyDay)
Dim Yourday As DateTime = MyToday.Add(MyAdd)
MsgBox("本周星期一的日期是:" Yourday)
dim 现在的时间 as date = Now
"Select * From 表 Where 开始的时间= # " 现在的时间 "# And 结束的时间= # " 现在的时间 " # "
Dim a As String
Dim b As Date
a = "2016-11-18"
b = CDate(a)
本例中最主要的就是CDate()函数,这个函数是用于把字符型变量转换成日期型变量,
字符型变量(本例中的a)如果不是标准的日期格式,请先用字符串函数处理成标准日期格式再用CDate函数进行转换,否则会报错