Ask a Question related to ASP.NET General, Design and Development.
-
Mark Fox #1
DateDiff in C#
Hello,
I am attempting to port some VB.NET code to C#.NET
and have run across the DateDiff function in VB.NET.
Does anyone know what the analogous function in C#.NET
is? Thanks!
Mark Fox Guest
-
Datediff() bug
The Datediff("m",startdate,enddate) function does not return the correct value if the startdate is "2/28/05" and the enddate has a day value of... -
dateDiff Question
During login I'm testing whether the user has changed their password in the last 90 days. Unfortunately the dateDiff function I'm using produces a... -
Datediff Problem
I am having some difficulties with the function Datediff! I am trying to calculate the number of days between two given date E.G: Number days... -
Datediff
Hello Newsgroup, I have a little problem. I want to know the difference between two dates but I need this in a german format. First Date :... -
DateDiff and Format
Hello, I've included a datediff function in my stored procedure, and it works correctly, but I want to format it to return only the Month and... -
Elliot Rodriguez #2
Re: DateDiff in C#
Mark:
You can use the TimeSpan object to help get the differences between 2 dates.
Check out this example:
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cscon/html/vctskcodedeterminingspanbetweentwodatesvisualc.asp[/url]
--
Elliot M. Rodriguez, MCSD
*** It would take 227 cans of Mountain Dew to kill me***
"Mark Fox" <info@solelsoftware.com> wrote in message
news:0a9f01c34b92$84d20290$a301280a@phx.gbl...> Hello,
>
> I am attempting to port some VB.NET code to C#.NET
> and have run across the DateDiff function in VB.NET.
> Does anyone know what the analogous function in C#.NET
> is? Thanks!
Elliot Rodriguez Guest
-
Anatoly #3
Re: DateDiff in C#
Look at
DateTime.Substract method
"Mark Fox" <info@solelsoftware.com> wrote in message
news:0a9f01c34b92$84d20290$a301280a@phx.gbl...> Hello,
>
> I am attempting to port some VB.NET code to C#.NET
> and have run across the DateDiff function in VB.NET.
> Does anyone know what the analogous function in C#.NET
> is? Thanks!
Anatoly Guest
-
Kevin Spencer #4
Re: DateDiff in C#
Check out the DateTime.Subtract() method.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of little things.
"Mark Fox" <info@solelsoftware.com> wrote in message
news:0a9f01c34b92$84d20290$a301280a@phx.gbl...> Hello,
>
> I am attempting to port some VB.NET code to C#.NET
> and have run across the DateDiff function in VB.NET.
> Does anyone know what the analogous function in C#.NET
> is? Thanks!
Kevin Spencer Guest



Reply With Quote

