PC Review


Reply
Thread Tools Rate Thread

DateTime truncation

 
 
JezB
Guest
Posts: n/a
 
      24th Feb 2004
I want to compare two DateTime values but only down to seconds, so how do I
truncate DateTime values to second granularity ?
Similarly, I may want to truncate to the minute granularity.
I also may want to round to the nearest minute.

How do I do these things ? I'm sure it must be really simple but I cant find
anything in the DateTime class. I know I can convert to a numeric date and
time format and do a string compare but I imagine this is a very inefficient
way to do it.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Millisecond values missing when inserting datetime into datetime column of sql Server Manikandan Microsoft C# .NET 4 18th Jul 2007 08:59 PM
How can I save a DateTime from my C# program into a SQL Server (datetime) database column. Steve Kershaw Microsoft ASP .NET 5 29th Aug 2006 03:10 AM
DateTime conversion to its sqlServer datetime float representation. A.Neves Microsoft C# .NET 1 20th Apr 2006 01:01 PM
DateTime truncation JezB Microsoft Dot NET Framework Forms 2 25th Feb 2004 05:39 PM
DateTime truncation JezB Microsoft C# .NET 3 24th Feb 2004 01:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:58 AM.