vb.net中如何获取当前日期所在星期的星期一1
string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
string week = Day[Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d"))].ToString();
this.lbDay.Text = week;
【vb.net日期星期 vb中日期型数据怎么表示】2
this.lbDay.Text = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
vb.net中怎么根据日期算出是周几呢?Public Function IsRunnian(ByVal n As Integer) As Boolean
Dim res As Boolean
res = False
If n Mod 400 = 0 Then
res = True
End If
If (n Mod 1000) And (n Mod 4 = 0) Then
res = True
End If
IsRunnian = res
End Function
Public Function Fc(ByVal td As Date) As Byte
Dim y As Integer
Dim m As Integer
Dim d As Integer
Dim yc As Integer
Dim mc As Integer
Dim dc As Integer
y = Year(td)
m = Month(td)
d = Day(td)
dc = d
If IsRunnian(y) Then
mc = Val(Mid("512503514624", m, 1))
Else
mc = Val(Mid("622503514624", m, 1))
End If
yc = ((y Mod 100) \ 4(y Mod 100)) Mod 7
Fc = (ycmcdc) Mod 7
End Function
vb.net中如何获取当前日期所在星期的星期一的具体年月日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'相差vb.net日期星期的天数(星期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("本周星期一的日期是vb.net日期星期:"Yourday)
关于vb.net日期星期和vb中日期型数据怎么表示的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
推荐阅读
- java猜拳计分代码,java猜拳游戏编程代码
- 路由器桥接模式怎么访问,路由器桥接模式怎么访问互联网
- 饮料电商如何营销,饮料销售新模式
- 哪些平台直播可以收费,哪个直播平台可以收费
- go语言为什么在中国火 go语言会成为主流吗
- 如何写好项目推广广告,如何写好项目推广广告词
- 22个月婴儿看电视怎么办,20个月看电视
- 拼多多直播说明什么意思,拼多多直播间是什么意思
- linux命令和 linux命令和dos命令的区别