日期功能显示日期为mm / dd / yy [英] Date function to display the date as mm/dd/yy
本文介绍了日期功能显示日期为mm / dd / yy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图以mm / dd / yy格式使用VB脚本获取日期。
I'm trying to get the date in mm/dd/yy format using VB Script.
但是我找不到任何功能来做这个要求,请问有人可以帮我吗
But I couldn't find any function to do the requirement , can some help me here please?
推荐答案
我喜欢使用.NET stringbuilder,因为我可以通过调整格式说明符而不是使用字符串操作:
I like to use the .NET stringbuilder, because I can switch formats on the fly by just adapting the format specifier instead of using string manipulation:
wscript.echo CreateObject("system.text.stringbuilder").AppendFormat("{0:MM}/{0:dd}/{0:yy}", now).ToString()
这篇关于日期功能显示日期为mm / dd / yy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文