All of my .NET assemblies uses the 1.0.* format for their version numbers. Supposedly the * gets replaced with the current date and time, translated into a number. What is the formula to translate it back into a date and time?
The AssemblyVersionAttribute
documentation states that:
The default build number increments daily. The default revision number is the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2.
The reference date for the build number isn't specified. In practice, I've found this to be 1 January 2000.
The date can therefore be reconstructed as follows:
var result = new DateTime(2000, 1, 1);
result = result.AddDays(buildNumber);
result = result.AddSeconds(revision * 2);
Since the reference date isn't documented, it can't be guaranteed to always remain unchanged.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With