vb.net 如何从 VB .NET 中的 Now() 减去小时
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27319820/
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
How to Subtract Hours from Now() in VB .NET
提问by TheDProgrammer
What is the simplest way to Subtract 9 Hours from NOW() in VB .NET?
在 VB .NET 中从 NOW() 中减去 9 小时的最简单方法是什么?
I am using NOW() function in VB .NET to get the Current DateTime in the below mentioned format:
我在 VB .NET 中使用 NOW() 函数以下面提到的格式获取当前日期时间:
"12/5/2014 9:24:47 PM"
“12/5/2014 9:24:47 PM”
I want to Subtract 9 Hours from the DateTime.
我想从日期时间中减去 9 小时。
Thanks
谢谢
回答by Calvin
DateTime.Now.AddHours(-9)
Check out http://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspxfor a list of methods.
查看http://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx以获取方法列表。

