如何在 VB.net 中比较两次 [英] How can I compare two times in VB.net

查看:22
本文介绍了如何在 VB.net 中比较两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 VB.net 中比较两次:

I want to compare two times in VB.net:

我有 1:42:21 PM,我想将它与 VB.net 中的 TimeOfDay 进行比较,我该怎么做?

I have 1:42:21 PM and I want it to compare with TimeOfDay in VB.net how can I do that?

推荐答案

New DateTime(1, 1, 1, 13, 42, 21) > TimeOfDay

或者您可以在 # 符号中包含一个 DateTime 表达式:

Or you can enclose a DateTime expression in # signs:

TimeOfDay > #1:42:21 PM#

这篇关于如何在 VB.net 中比较两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆