[This is preliminary documentation and is subject to change.]

Provides utility functions for working with DateTime and TimeSpan.

Namespace: fCraft
Assembly: fCraft (in fCraft.dll) Version: 0.6.3.5 (0.6.3.5)

Syntax

   
 C# 
public static class DateTimeUtil

Members

         
 All Members  Fields   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
MaxTimeSpan
Longest reasonable value that fCraft will allow to be entered for time spans (9999 days).
ParseMiniTimespan(String)
Parses the given string as a TimeSpan in compact representation. Throws exceptions on failure.
ToCompactString(DateTime)
ToCompactString(TimeSpan)
ToMiniString(TimeSpan)
Converts given TimeSpan to compact string representation.
ToSecondsString(TimeSpan)
Converts a TimeSpan to a string containing the number of seconds. If the timestamp is zero seconds, returns an empty string.
ToSecondsString(TimeSpan, StringBuilder)
Serializes the given TimeSpan to the given StringBuilder, as the number of seconds.
ToUnixTime(DateTime)
Converts a DateTime to UTC Unix Timestamp.
ToUnixTimeString(DateTime)
Converts a DateTime to a string containing the UTC Unix Timestamp. If the date equals DateTime.MinValue, returns an empty string.
ToUnixTimeString(DateTime, StringBuilder)
Appends a UTC Unix Timestamp to the given StringBuilder. If the date equals DateTime.MinValue, nothing is appended.
TryParseDateTime(Int64)
Creates a DateTime from a Utc Unix Timestamp.
TryParseDateTime(String, DateTime%)
Tries to create a DateTime from a string containing a Utc Unix Timestamp. If the string was empty, returns false and does not affect result.
TryParseMiniTimespan(String, TimeSpan%)
Attempts to parse the given string as a TimeSpan in compact representation. No exception is thrown if parsing failed.
TryParseTimeSpan(String, TimeSpan%)
Tries to create a TimeSpan from a string containing the number of seconds. If the string was empty, returns false and sets result to TimeSpan.Zero
UnixEpoch
UTC Unix epoch (1970-01-01, 00:00:00).

Inheritance Hierarchy

System..::..Object
  fCraft..::..DateTimeUtil

See Also