使用 excel vba 函数的当前时间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11684888/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Day current time for function using excel vba
提问by Devendar
searched on Google I found one. Is it possible to format time in [h]:mm format using VBA?
在谷歌上搜索我找到了一个。是否可以使用 VBA 以 [h]:mm 格式格式化时间?
Dim currentTime As Date
currentTime = TimeOfDay
I passed currentTime
into database when I dumped data - showing put put as 00.00.00.000000
not understood why its showing different? Is there any other function to call current time 00.00 AM/PM
我currentTime
在转储数据时传入了数据库 - 显示 put put00.00.00.000000
不明白为什么它显示不同?有没有其他函数可以调用当前时间00.00 AM/PM
回答by brettdj
To format the current time to your specs try
要将当前时间格式化为您的规格,请尝试
MsgBox Format(Now(), "hh:mm AMPM")