Kirjaudu
Google-sovellukset
Päävalikko
Post a Comment On:
mo.notono.us
"C#: DateCompiled()"
No comments yet. -
1 – 0 of 0
.csharpcode, .csharpcode pre { font-size: 7pt; color: black; font-family: Consolas, "Courier New", Courier, Monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } /// <summary>Gets the executing assembly's compile date and time.</summary> /// <remarks> /// Assumes that in AssemblyInfo.cs, the version is specified as 1.0.* or the like, /// with only 2 numbers specified; the next two are generated from the date. /// version.Build is days since Jan. 1, 2000 /// version.Revision*2 is seconds since local midnight (NEVER daylight saving time) /// Adapted from code at
http://www.thescripts.com/forum/thread226146.html
/// </remarks> /// <returns>The executing assembly's compile date and time</returns> public static DateTime DateCompiled() { Version version = Assembly.GetExecutingAssembly().GetName().Version; bool isDaylightSavingsTime = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now); return new DateTime(2000, 1, 1). AddDays(version.Build). AddSeconds(version.Revision * 2). AddHours(isDaylightSavingsTime ? 1 : 0); } Tags:
.net
programming
posted by Oskar Austegard at
11:00 AM
on Jul 26, 2006
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
Comments on this blog are restricted to team members.
Google Account
You will be asked to sign in after submitting your comment.
Please prove you're not a robot
"C#: DateCompiled()"
No comments yet. -