C# DateTimeOffset ToFileTime

Description

DateTimeOffset ToFileTime converts the value of the current DateTimeOffset object to a Windows file time.

Syntax

DateTimeOffset.ToFileTime has the following syntax.


public long ToFileTime()

Returns

DateTimeOffset.ToFileTime method returns The value of the current DateTimeOffset object, expressed as a Windows file time.

Example


//from  w  ww.j av  a  2 s .c  om
using System;
public class MainClass{
  public static void Main(String[] argv){  
    DateTimeOffset originalTime, localTime;
    
    originalTime = new DateTimeOffset(2014, 3, 11, 3, 0, 0, 
                                      new TimeSpan(-6, 0, 0));
    Console.WriteLine(originalTime.ToFileTime());   

  }
}
    

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version