如何在C#中使用datediff和dateinterval [英] How to use datediff and dateinterval in C#

查看:783
本文介绍了如何在C#中使用datediff和dateinterval的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VB中有以下代码行



 DateDiff(DateInterval.Day,dateupdated,Date.Today())< > 0)





我没有在C#中找到DateDiff函数。



任何人都可以帮我解决如何用C语言写这个#



预付谢谢



我尝试了什么:



我写了

(dateupdated-今天) .totaldays!=  0  



这是正确的吗?如果它是正确的那么Dateinterval.day呢。如何使用它。

或建议我正确的语法

解决方案

请参阅以下链接

C#中的DateDiff函数ASP.NET论坛 [ ^ ]

I have the below line of code in VB

DateDiff(DateInterval.Day, dateupdated, Date.Today()) <> 0 )



I didn't find the DateDiff function in C#.

Can anybody help me out how to write this in C#

Thanks in Advance

What I have tried:

I have written

(dateupdated-today).totaldays!=0


Is this correct? if it is correct then what about Dateinterval.day. How to use it.
Or suggest me the correct syntax

解决方案

Refer below link
DateDiff function in C# | The ASP.NET Forums[^]


这篇关于如何在C#中使用datediff和dateinterval的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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