更改日期格式(VB.net) [英] Change date format (VB.net)
本文介绍了更改日期格式(VB.net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好!
我使用的是VB.net 2005
有没有办法以这种格式显示日期:
< pre lang =PHP> 2014年5月13日
没有关闭月份的'0'?
解决方案
是:
Dim s As 字符串 = DateTime.Now.ToString( dd / MM / yyyy)
见这里:格式化显示的日期时间 - 格式字符串描述 [ ^ ]
Hello!
I am using VB.net 2005
Is there a way i can display a date in this format:
05/13/2014
without taking the '0' off the month?
解决方案
Yes:
Dim s As String = DateTime.Now.ToString("dd/MM/yyyy")
See here: Formatting a DateTime for display - format string description[^]
这篇关于更改日期格式(VB.net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文