Converting time to Military
Posted
by Chris
on Stack Overflow
See other posts from Stack Overflow
or by Chris
Published on 2010-03-10T13:13:58Z
Indexed on
2010/04/13
20:43 UTC
Read the original article
Hit count: 451
Maybe I'm seeing things..
In an attempt to turn a date with a format of "mm/dd/yyyy hh:mm:ss PM"
into military time, the following replacement of a row value does not seem to take. Even though I am sure I have done this before (with column values other than dates). Is there some reason that
row["adate"]
would not accept a value assigned to it in this case?
DateTime oos = DateTime.Parse(row["adate"].ToString());
row["adate"] = oos.Month.ToString()
+ "/"
+ oos.Day.ToString()
+ "/"
+ oos.Year.ToString()
+ " "
+ oos.Hour.ToString()
+ ":"
+ oos.Minute.ToString();
© Stack Overflow or respective owner