« DataGrid, IsSelected method’s row argument’s domain is the DataView | Main | MD5 Password Hash Pattern »

AssemblyVersion equals build time

As documented , using an asterisk for build and revision numbers  yields a build equal to the number of days since January 1, 2000 local time, and for revision to be equal to the number of seconds since midnight local time, divided by 2.

 

Thus a revision number can be turned into a build time with the formula:

 

AssemblyName an = Assembly.GetEntryAssembly().GetName();

DateTime d = new DateTime(2000, 1, 1, 0, 0, 0);

d += TimeSpan.FromDays(an.Version.Build) + TimeSpan.FromSeconds(an.Version.Revision * 2);

 

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)