但我的VB.NET认为不同:
DeBUG.Print("Weekday for the date '21.10.2012.'is " & Weekdayname(Weekday("21.10.2012.")))DeBUG.Print("Weekday for the date '21/10/2012'is " & Weekdayname(Weekday("21/10/2012")))DeBUG.Print("Weekday for the date '" & DateTime.Now.Date & "'is " & Weekdayname(Weekday(DateTime.Now.Date)))
所有这3张支票都给我:工作日名称’星期一’!
如何获得合适的工作日名称?
Dim myCulture As System.Globalization.CultureInfo = Globalization.CultureInfo.CurrentCultureDim dayOfWeek As DayOfWeek = myCulture.Calendar.GetDayOfWeek(Date.Today)' dayOfWeek.ToString() would return "Sunday" but it's an enum value,' the correct dayname can be retrIEved via DateTimeFormat.' Following returns "Sonntag" for me since i'm in germany 'Dim dayname As String = myCulture.DateTimeFormat.GetDayname(dayOfWeek)总结
以上是内存溢出为你收集整理的Vb.net得到了工作日的名字全部内容,希望文章能够帮你解决Vb.net得到了工作日的名字所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)