.Net DateTime bug? Or just poorly designed -
this behavior caused me waste significant amount of time past week. have explanation why designed way ???|
(i in pst, dst offset +7 right now)
var utc = new datetime(2012, 6, 5, 9, 0, 0, datetimekind.utc); var lcl = new datetime(2012, 6, 5, 8, 0, 0, datetimekind.local); // 15:00 utc assert.istrue(lcl.touniversaltime() > utc); // succeeds (as should) assert.istrue(lcl > utc); // fails (with same times!!!) this doubly confusing because in actual code, variable had kind set to datetimekind.local originally set datetimekind.utc (on machine) being evaluated after network transfer machine comparison being made, , had had kind changed during transfer (using net.tcp remoting).
it's known, , related this: http://msmvps.com/blogs/jon_skeet/archive/2012/05/02/more-fun-with-datetime.aspx
Comments
Post a Comment