C# Class Thrinax.Helper.TimeHelper

Datei anzeigen Open project: ziyunhx/thrinax

Public Methods

Method Description
ConvertDateTimeInt ( System.DateTime time ) : long

change csharp DateTime to Unix timestamp

ConvertIntDateTime ( long d ) : System.DateTime

change Unix timestamp to csharp DateTime

GetDateTime ( string timeStamp ) : DateTime?

时间戳转为C#格式时间,无法转换时返回null

GetTime ( string timeStamp ) : System.DateTime

时间戳转为C#格式时间,无法转换时返回当前时间

GetUnixTimeStamp ( System.DateTime argDateTime ) : long

获取时间戳(10位)

Method Details

ConvertDateTimeInt() public static method

change csharp DateTime to Unix timestamp
public static ConvertDateTimeInt ( System.DateTime time ) : long
time System.DateTime DateTime
return long

ConvertIntDateTime() public static method

change Unix timestamp to csharp DateTime
public static ConvertIntDateTime ( long d ) : System.DateTime
d long timestamp
return System.DateTime

GetDateTime() public static method

时间戳转为C#格式时间,无法转换时返回null
public static GetDateTime ( string timeStamp ) : DateTime?
timeStamp string Unix时间戳格式
return DateTime?

GetTime() public static method

时间戳转为C#格式时间,无法转换时返回当前时间
public static GetTime ( string timeStamp ) : System.DateTime
timeStamp string Unix时间戳格式
return System.DateTime

GetUnixTimeStamp() public static method

获取时间戳(10位)
public static GetUnixTimeStamp ( System.DateTime argDateTime ) : long
argDateTime System.DateTime
return long