Re: _TIMESTAMP_ and __TIME__ equivalent in C#

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Ben Voigt [C++ MVP] wrote:
Eitan wrote:
Hello,

I would like to display a timestamp of when the application was
compiled. In C++ I used the _TIMESTAMP_ and __TIME__ etc.

Do we have anything equivalent in C# and .NET?

[assembly: AssemblyVersion("1.1.*")]
When specifying a version, you have to at least specify major. If you
specify major and minor, you can specify an asterisk (*) for build.
This will cause build to be 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.

BTW, it's a little confusing to find the version at runtime, you need
Assembly.GetName().Version




Thanks,
EitanB


.



Relevant Pages

  • RE: Build number does not seem to increment
    ... equal to the number of seconds since midnight local time, ... Also you can specify an asterisk for revision number. ...
    (microsoft.public.vsnet.general)
  • Re: Restart a dll Build Number and Revision
    ... Matt Berther wrote: ... If you specify major and minor, you can specify an asterisk for build. ... This causes build to be equal to the number of days since January 1, 2000, local time, and revision to be equal to the number of seconds since midnight, January 1, 2000, local time, divided by 2. ... If you specify major, minor, and build, you can specify an asterisk for revision. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Date formatting
    ... >I'm afraid the data itself will not lead to a determined decoding. ... >You should ask the user to specify a mask. ... Local time, ...
    (alt.comp.lang.borland-delphi)
  • Re: _TIMESTAMP_ and __TIME__ equivalent in C#
    ... I would like to display a timestamp of when the application was ... When specifying a version, you have to at least specify major. ... midnight local time, divided by 2. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Restart a dll Build Number and Revision
    ... If you specify major and minor, you can specify an asterisk for build. ... This causes build to be equal to the number of days since January 1, 2000, local time, and revision to be equal to the number of seconds since midnight, January 1, 2000, local time, divided by 2. ... If you specify major, minor, and build, you can specify an asterisk for revision. ...
    (microsoft.public.dotnet.framework.aspnet)