SoFunction
Updated on 2025-03-07

How to convert time into file name

Return value
Type: System.Int64
The value of the current DateTime object represented as the time of the Windows file.

For example:

Copy the codeThe code is as follows:

().ToString()

You will get a string, similar to the result: 130308237880937500

Windows file time is a 64-bit value that represents the number of intervals (in one interval of 100 nanoseconds) that have passed since midnight on Coordinated Universal Time (UTC) AD (.) 1601 January 1, 1601. Windows uses file time to record when an application creates, accesses, or writes files.

Previous versions of the ToFileTime method assume that the current DateTime object is local time. Starting with .NET Framework version 2.0, the ToFileTime method uses the Kind property to determine whether the current DateTime object is local time, UTC time, or an unspecified type of time that is considered local time.