UJ said:
I want to add to my about box a message of when the system was last
compiled. Is there any way to get this?
Yes. I wrote the below function for the very reason you describe and, from
my initial tests, it looks like it works as expected. It takes advantage of
the fact that the Build and Revision values are based on the current
date/time.
Enjoy!
- Mitchell S. Honnert
Private Function GetVersionDate() As Date
Dim MyVersion As Version =
System.Reflection.Assembly.GetExecutingAssembly.GetName.Version
'Base date is 1/1/2000
Dim VersionDate As Date = New Date(2000, 1, 1)
'Build number is days since 1/1/2000, so add days
VersionDate = VersionDate.AddDays(MyVersion.Build)
'Revision number is half the seconds since midnight, so add twice as many
seconds
VersionDate = VersionDate.AddSeconds(MyVersion.Revision * 2)
Return VersionDate
End Function