![]() |
| |||||||
| Sponsored Links |
![]() | « Previous Thread | Next Thread » |
| | LinkBack (1) | Thread Tools | Display Modes |
#1
| ||||
| ||||
| We have a requirement on our intranet to display the file date/time of our applciations. There doesn't appear to be a simple way to do this in .NET, but I came up with the following to display what is, basically, the file date/time of the assembly DLL. In AssemblyInfo.cs ensure you have the following: Code: [assembly: AssemblyVersion("2.1.*")]
major.minor.date.time where date is the number of day since 01 JAN 2000 time is the number of seconds since midnight / 2 So, to return the 'compile' date of the Assembly, I use the following Property: Code: public string lastModified
{
get
{
string[] strArray = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split(new char[] { '.' });
return new DateTime(2000, 1, 1).AddDays(Convert.ToDouble(strArray[2])).AddSeconds(Convert.ToDouble(strArray[3]) * 2).ToString();
}
}
|
| Sponsored Links |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| edit one at a time | guddu | JavaScript Programming | 4 | August 21st, 2008 10:57 AM |
| keep time and date | javier_83 | Microsoft Access | 6 | August 15th, 2008 06:03 PM |
| [JavaScript] JavaScript Date & Time Display | jmurrayhead | Code Samples | 0 | August 13th, 2008 08:46 PM |
| Time Entry Form | sbenj69 | Microsoft Access | 2 | July 14th, 2008 02:11 PM |
| Site Down Time | jmurrayhead | Announcements | 0 | March 30th, 2008 09:42 AM |
LinkBacks (?)
LinkBack to this Thread: http://www.developerbarn.com/code-samples/115-display-assembly-file-date-time.html | ||||
| Posted By | For | Type | Date | |
| DeveloperBarn Forums - ASP Help, ASP.Net Help, PHP Help, SQL Help, Tutorials, Windows Help | This thread | Refback | April 26th, 2008 09:35 AM | |