Datetime issue

The nasty datetime format issue seems like is universal. In c# world, depends on the locale, it would format to string and parse to datetime differently and could wrongly as well.

For example, for cultureinfo (“ja-JP”), datetime.tostring() could be yyyy/MM/d format which not recognized by a lot other systems or places.
While for same locale, it would parse 04Apr16 as 2004-04-16.

To solve and avoid the issues, invariantculture should be the cure. Always use invariantculture for parsing and for formating:
Datetime.parseExact(dateString, format, invariantculture).tostring(format, invariantculture).

Visual studio debug

I was trying to debug some ms office add in, then noticed this cool featurr of VS 2010.

Instead of starting the project in debug mode, which someitmes could have various issues, just start the ms office, then through VS debug –> attach process, to link the project source code is quick and effective option.