Developer
Status:
|
NOT LOGGED IN  
|
BerliOS Developer Foundries
|


|
|
|
Browse
| Submit A New Snippet
| Create A Package
Convert CTime to C# DateTime
|
Type:
Function |
Category:
Math Functions
|
License:
GNU General Public License |
Language:
C#
|
Description:
Converts ctime to C# DateTime format
|
Versions Of This Snippet:
| Snippet ID |
Download Version |
Date Posted |
Author |
Delete |
| 000055 | 000001 | 2005-Dec-25 07:26 | pravin |  |
Download a raw-text version of this code by clicking on "Download Version"
Latest Snippet Version: 1
/// <summary>
/// Converts ctime to C# DateTime format
/// </summary>
/// <param name="ctime">ctime to convert</param>
/// <returns>DateTime object</returns>
private DateTime MakeDTFromCTime(int ctime)
{
long win32FileTime = 10000000 * (long)ctime + 116444736000000000;
DateTime dt = DateTime.FromFileTime(win32FileTime);
return dt;
}
You can submit a new version of this snippet if you have modified it
and you feel it is appropriate to share with others.
|
|