Is .NET DateTime buggy using ToString("U")? -


i have next simple code...

console.writeline(default(datetime).date.tostring("u")); 

the, emitted text (i have spanish language installation): "lunes, 01 de enero de 0001 3:00:00"

why starts @ 3 hours, instead of 0? bug?

well unless you've got time machine or datetime really buggy, that's not output of code posted, uses datetime.now.

i suspect code really using datetime.minvalue (or new datetime()), , reason you're seeing 3am (as per documentation):

the pattern same "f" pattern. however, datetime value automatically converted utc before formatted.

so suspect you're in time zone midnight on january 1st 0001 local time 3am utc. (datetimezone.minvalue has "kind" of unspecified, treated local when asked convert utc. datetime bit of mess around area.)


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -