X
xenophon
Does anyone have a code snippet for converting the time portion of a
DateTime to seconds since midnight?
Thanks.
DateTime to seconds since midnight?
Thanks.
Use TimeOfDay as in:Lloyd said:what about something like that:
// warning: pseudo code from the back of my mind
DateTime dt0;
DateTime dt = new DateTime(dt0.Year, dt0.Month, dt0.Day, 0, 0, 0);
TimeSpan ts = dt - dt0;
return ts.Seconds;