vb.net DateTime.Now 和接下来的 15 分钟

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25152555/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 17:58:50  来源:igfitidea点击:

vb.net DateTime.Now and next 15 mins

vb.netdatetime

提问by ???????? ???????????

 New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, Now.Minute + 15, Now.Second)

im want to get time next now 15 mins but i use this code but don't work...

我想在接下来的 15 分钟内腾出时间,但我使用此代码但不起作用...

it will error if now more than "XX:46" pls help me

如果现在超过“XX:46”请帮助我,它会出错

回答by Luke Hoffmann

Date.Now().AddMinutes(15)

Date.Now().AddMinutes(15)

It's better to use the built-in method of the Date type than to create a new New DateTime.

最好使用 Date 类型的内置方法,而不是创建一个新的 New DateTime。

回答by Jatin Gadhiya

You can do,

你可以做,

Dim MyDateTime AS DateTime
MyDateTime.Now().AddMinutes(15)

now you can use MyDateTime

现在您可以使用 MyDateTime

i hope this help you

我希望这对你有帮助