fCraft.DateTimeUtil.ToDateTime C# (CSharp) Method

ToDateTime() public static method

Creates a DateTime from a UTC Unix Timestamp.
public static ToDateTime ( long timestamp ) : System.DateTime
timestamp long
return System.DateTime
        public static DateTime ToDateTime( long timestamp ) {
            return UnixEpoch.AddSeconds( timestamp );
        }

Same methods

DateTimeUtil::ToDateTime ( this timestamp ) : System.DateTime
DateTimeUtil::ToDateTime ( this str, System.DateTime &result ) : bool

Usage Example

 static DateTime ReadDate([NotNull] BinaryReader reader)
 {
     if (reader.ReadBoolean())
     {
         return(DateTimeUtil.ToDateTime(reader.ReadUInt32()));
     }
     else
     {
         return(DateTime.MinValue);
     }
 }
All Usage Examples Of fCraft.DateTimeUtil::ToDateTime