Thursday, February 23, 2006

.NET String Formatting gotcha

Ok, so I found the problem.

I was using this snippet of code to format the date:


What I should have been using was:


Notice the "hh" versus "HH". The small hh gives 12-hour hours, and the large HH gives 24 hour hours. So, 9PM with hh is 09, and 9PM with HH is 21.

Blogger expects the 24-hour time format, so my post showed up as 12 hours earlier than it should have been.

All fixed now, though.

No comments: