Tried to cast the datatime object ,which is queried from database. Value is in UTC time. is it affect the local timezone when i tried to cast the object ?
var daytime = (DateTime)reader["day"];
reader["day"] is a object and value is in UTC time. For accessing the value i changed it into DateTime. my intention is i want to convert this value to epoch time.
var daytime = (DateTime)reader["day"];
long epochTicks = new DateTime(1970, 1, 1).Ticks;
long unixTime = ((daytime.Ticks - epochTicks) / TimeSpan.TicksPerSecond);