I have this line of code:
double seconds = new DateTime(2006,7,6,12,1,0,DateTimeKind.Local).Subtract(new DateTime(1970,1,1,0,0,0,DateTimeKind.Local).TotalSeconds;
This was the wrong number I wanted, so I tried the following:
double seconds = new DateTime(2006,7,6,12,1,0,DateTimeKind.Local).Subtract(new DateTime(1970,1,1,0,0,0,DateTimeKind.Utc).TotalSeconds;
(The difference is that in one case I use local time for an era, and in another - UTC). Interestingly, however, they both give me the same value, and I do not know why this is so. I live at -600 GMT, so DateTimeKind.Local really has to influence things.
Thanks in advance!
timezone c # datetime
codersarepeople
source share