Link to home
Start Free TrialLog in
Avatar of dshinkle
dshinkle

asked on

Remove seconds from a date

I have a date datatype in C# that is a date and time.  I need to remove the seconds from the date, so that if it is

12/29/2005 5:36:54 it would be 12/29/2005 5:36:00.  How can I do this?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dshinkle
dshinkle

ASKER

Thank you!  .NET rocks!
Actually that answer doesn't work.  That property is read only.
This should be better then:
DateTime v = DateTime.Now;
v = v.Subtract(new TimeSpan(0,0,0,v.Second,0));