vb.net日期和星期,vb星期代码

vb.net中如何获取当前日期所在星期的星期一

1

创新互联专注于江安网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供江安营销型网站建设,江安网站制作、江安网页设计、江安网站官网定制、微信小程序服务,打造江安网络公司原创品牌,更为您提供江安网站排名全网营销落地服务。

string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };

string week = Day[Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d"))].ToString();

this.lbDay.Text = week;

2

this.lbDay.Text = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);

vb编程日期转换为星期

Private Sub Form_Load()

Text1.Text = ""

End SubPrivate Sub Command1_Click()

Dim s As String

Dim w As Integer

s = Text1.Text

w = Weekday(s) - 1

Select Case w

Case Is = 1

Label2.Caption = "当前是星期一"

Case Is = 2

Label2.Caption = "当前是星期二"

Case Is = 3

Label2.Caption = "当前是星期三"

Case Is = 4

Label2.Caption = "当前是星期四"

Case Is = 5

Label2.Caption = "当前是星期五"

Case Is = 6

Label2.Caption = "当前是星期六"

Case Is = 7

Label2.Caption = "当前是星期日"

End Select

End Sub

用基于vb的asp.net编写显示当前日期时间和星期几的代码怎么写?急用

C#

string [] Day=new string []{"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};

Console.WriteLine(Day[Convert.ToInt16(DateTime.Now.DayOfWeek)]);

相信VB.net的你,应该懂的。

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 100  0) 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 = (yc + mc + dc) Mod 7

End Function

vb.net 简易日历

楼主,咱们是校友啊,我今年也做这个程序,能给我发一份程序呗,谢啦!!!QQ:2648039855

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 '相差的天数(星期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)


文章名称:vb.net日期和星期,vb星期代码
浏览地址:http://scyanting.com/article/dscgoig.html