Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.DateTime Struct Reference

Classes

class  LeapSecondCache
 

Public Member Functions

 DateTime (long ticks)
 
 DateTime (long ticks, DateTimeKind kind)
 
 DateTime (int year, int month, int day)
 
 DateTime (int year, int month, int day, Calendar calendar)
 
 DateTime (int year, int month, int day, int hour, int minute, int second)
 
 DateTime (int year, int month, int day, int hour, int minute, int second, DateTimeKind kind)
 
 DateTime (int year, int month, int day, int hour, int minute, int second, Calendar calendar)
 
 DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond)
 
 DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, DateTimeKind kind)
 
 DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar)
 
 DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar, DateTimeKind kind)
 
DateTime Add (TimeSpan value)
 
DateTime AddDays (double value)
 
DateTime AddHours (double value)
 
DateTime AddMilliseconds (double value)
 
DateTime AddMinutes (double value)
 
DateTime AddMonths (int months)
 
DateTime AddSeconds (double value)
 
DateTime AddTicks (long value)
 
DateTime AddYears (int value)
 
int CompareTo (object? value)
 
int CompareTo (DateTime value)
 
override bool Equals ([NotNullWhen(true)] object? value)
 
bool Equals (DateTime value)
 
void ISerializable. GetObjectData (SerializationInfo info, StreamingContext context)
 
bool IsDaylightSavingTime ()
 
long ToBinary ()
 
override int GetHashCode ()
 
TimeSpan Subtract (DateTime value)
 
DateTime Subtract (TimeSpan value)
 
double ToOADate ()
 
long ToFileTime ()
 
long ToFileTimeUtc ()
 
DateTime ToLocalTime ()
 
string ToLongDateString ()
 
string ToLongTimeString ()
 
string ToShortDateString ()
 
string ToShortTimeString ()
 
override string ToString ()
 
string ToString (string? format)
 
string ToString (IFormatProvider? provider)
 
string ToString (string? format, IFormatProvider? provider)
 
bool TryFormat (Span< char > destination, out int charsWritten, ReadOnlySpan< char > format=default(ReadOnlySpan< char >), IFormatProvider? provider=null)
 
DateTime ToUniversalTime ()
 
string[] GetDateTimeFormats ()
 
string[] GetDateTimeFormats (IFormatProvider? provider)
 
string[] GetDateTimeFormats (char format)
 
string[] GetDateTimeFormats (char format, IFormatProvider? provider)
 
TypeCode GetTypeCode ()
 
bool IConvertible. ToBoolean (IFormatProvider provider)
 
char IConvertible. ToChar (IFormatProvider provider)
 
sbyte IConvertible. ToSByte (IFormatProvider provider)
 
byte IConvertible. ToByte (IFormatProvider provider)
 
short IConvertible. ToInt16 (IFormatProvider provider)
 
ushort IConvertible. ToUInt16 (IFormatProvider provider)
 
int IConvertible. ToInt32 (IFormatProvider provider)
 
uint IConvertible. ToUInt32 (IFormatProvider provider)
 
long IConvertible. ToInt64 (IFormatProvider provider)
 
ulong IConvertible. ToUInt64 (IFormatProvider provider)
 
float IConvertible. ToSingle (IFormatProvider provider)
 
double IConvertible. ToDouble (IFormatProvider provider)
 
decimal IConvertible. ToDecimal (IFormatProvider provider)
 
DateTime IConvertible. ToDateTime (IFormatProvider provider)
 
object IConvertible. ToType (Type type, IFormatProvider provider)
 
int CompareTo (T? other)
 
bool ToBoolean (IFormatProvider? provider)
 
char ToChar (IFormatProvider? provider)
 
sbyte ToSByte (IFormatProvider? provider)
 
byte ToByte (IFormatProvider? provider)
 
short ToInt16 (IFormatProvider? provider)
 
ushort ToUInt16 (IFormatProvider? provider)
 
int ToInt32 (IFormatProvider? provider)
 
uint ToUInt32 (IFormatProvider? provider)
 
long ToInt64 (IFormatProvider? provider)
 
ulong ToUInt64 (IFormatProvider? provider)
 
float ToSingle (IFormatProvider? provider)
 
double ToDouble (IFormatProvider? provider)
 
decimal ToDecimal (IFormatProvider? provider)
 
DateTime ToDateTime (IFormatProvider? provider)
 
object ToType (Type conversionType, IFormatProvider? provider)
 
int CompareTo (T? other)
 
bool Equals (T? other)
 

Static Public Member Functions

static int Compare (DateTime t1, DateTime t2)
 
static int DaysInMonth (int year, int month)
 
static bool Equals (DateTime t1, DateTime t2)
 
static DateTime FromBinary (long dateData)
 
static DateTime FromFileTime (long fileTime)
 
static DateTime FromFileTimeUtc (long fileTime)
 
static DateTime FromOADate (double d)
 
static DateTime SpecifyKind (DateTime value, DateTimeKind kind)
 
static bool IsLeapYear (int year)
 
static DateTime Parse (string s)
 
static DateTime Parse (string s, IFormatProvider? provider)
 
static DateTime Parse (string s, IFormatProvider? provider, DateTimeStyles styles)
 
static DateTime Parse (ReadOnlySpan< char > s, IFormatProvider? provider=null, DateTimeStyles styles=DateTimeStyles.None)
 
static DateTime ParseExact (string s, string format, IFormatProvider? provider)
 
static DateTime ParseExact (string s, string format, IFormatProvider? provider, DateTimeStyles style)
 
static DateTime ParseExact (ReadOnlySpan< char > s, ReadOnlySpan< char > format, IFormatProvider? provider, DateTimeStyles style=DateTimeStyles.None)
 
static DateTime ParseExact (string s, string[] formats, IFormatProvider? provider, DateTimeStyles style)
 
static DateTime ParseExact (ReadOnlySpan< char > s, string[] formats, IFormatProvider? provider, DateTimeStyles style=DateTimeStyles.None)
 
static bool TryParse ([NotNullWhen(true)] string? s, out DateTime result)
 
static bool TryParse (ReadOnlySpan< char > s, out DateTime result)
 
static bool TryParse ([NotNullWhen(true)] string? s, IFormatProvider? provider, DateTimeStyles styles, out DateTime result)
 
static bool TryParse (ReadOnlySpan< char > s, IFormatProvider? provider, DateTimeStyles styles, out DateTime result)
 
static bool TryParseExact ([NotNullWhen(true)] string? s, [NotNullWhen(true)] string? format, IFormatProvider? provider, DateTimeStyles style, out DateTime result)
 
static bool TryParseExact (ReadOnlySpan< char > s, ReadOnlySpan< char > format, IFormatProvider? provider, DateTimeStyles style, out DateTime result)
 
static bool TryParseExact ([NotNullWhen(true)] string? s, [NotNullWhen(true)] string?[]? formats, IFormatProvider? provider, DateTimeStyles style, out DateTime result)
 
static bool TryParseExact (ReadOnlySpan< char > s, [NotNullWhen(true)] string?[]? formats, IFormatProvider? provider, DateTimeStyles style, out DateTime result)
 
static DateTime operator+ (DateTime d, TimeSpan t)
 
static DateTime operator- (DateTime d, TimeSpan t)
 
static TimeSpan operator- (DateTime d1, DateTime d2)
 
static bool operator== (DateTime d1, DateTime d2)
 
static bool operator!= (DateTime d1, DateTime d2)
 
static bool operator< (DateTime t1, DateTime t2)
 
static bool operator<= (DateTime t1, DateTime t2)
 
static bool operator> (DateTime t1, DateTime t2)
 
static bool operator>= (DateTime t1, DateTime t2)
 
static DateTime IAdditionOperators< DateTime, TimeSpan, DateTime >. operator+ (DateTime left, TimeSpan right)
 
static bool IComparisonOperators< DateTime, DateTime >. operator< (DateTime left, DateTime right)
 
static bool IComparisonOperators< DateTime, DateTime >. operator<= (DateTime left, DateTime right)
 
static bool IComparisonOperators< DateTime, DateTime >. operator> (DateTime left, DateTime right)
 
static bool IComparisonOperators< DateTime, DateTime >. operator>= (DateTime left, DateTime right)
 
static bool IEqualityOperators< DateTime, DateTime >. operator== (DateTime left, DateTime right)
 
static bool IEqualityOperators< DateTime, DateTime >. operator!= (DateTime left, DateTime right)
 
static DateTime IParseable< DateTime >. Parse (string s, IFormatProvider provider)
 
static bool IParseable< DateTime >. TryParse ([NotNullWhen(true)] string s, IFormatProvider provider, out DateTime result)
 
static DateTime ISpanParseable< DateTime >. Parse (ReadOnlySpan< char > s, IFormatProvider provider)
 
static bool ISpanParseable< DateTime >. TryParse (ReadOnlySpan< char > s, IFormatProvider provider, out DateTime result)
 
static DateTime ISubtractionOperators< DateTime, TimeSpan, DateTime >. operator- (DateTime left, TimeSpan right)
 
static TimeSpan ISubtractionOperators< DateTime, DateTime, TimeSpan >. operator- (DateTime left, DateTime right)
 
static TResult operator+ (TSelf left, TOther right)
 
static bool operator< (TSelf left, TOther right)
 
static bool operator<= (TSelf left, TOther right)
 
static bool operator> (TSelf left, TOther right)
 
static bool operator>= (TSelf left, TOther right)
 
static bool operator== (TSelf left, TOther right)
 
static bool operator!= (TSelf left, TOther right)
 
static TSelf Parse (ReadOnlySpan< char > s, IFormatProvider? provider)
 
static bool TryParse (ReadOnlySpan< char > s, IFormatProvider? provider, out TSelf result)
 
static bool TryParse ([NotNullWhen(true)] string? s, IFormatProvider? provider, out TSelf result)
 
static TResult operator- (TSelf left, TOther right)
 
static TResult operator- (TSelf left, TOther right)
 

Static Public Attributes

static readonly DateTime MinValue
 
static readonly DateTime MaxValue = new DateTime(3155378975999999999L, DateTimeKind.Unspecified)
 
static readonly DateTime UnixEpoch = new DateTime(621355968000000000L, DateTimeKind.Utc)
 

Package Functions

 DateTime (long ticks, DateTimeKind kind, bool isAmbiguousDst)
 
bool TryAddTicks (long value, out DateTime result)
 
void GetDate (out int year, out int month, out int day)
 
void GetTime (out int hour, out int minute, out int second)
 
void GetTime (out int hour, out int minute, out int second, out int millisecond)
 
void GetTimePrecise (out int hour, out int minute, out int second, out int tick)
 
bool IsAmbiguousDaylightSavingTime ()
 

Static Package Functions

static DateTime UnsafeCreate (long ticks)
 
static ulong TimeToTicks (int hour, int minute, int second, int millisecond)
 
static long DoubleDateToTicks (double value)
 
static bool TryCreate (int year, int month, int day, int hour, int minute, int second, int millisecond, out DateTime result)
 
static unsafe bool IsValidTimeWithLeapSeconds (int year, int month, int day, int hour, int minute, DateTimeKind kind)
 

Static Package Attributes

static readonly bool s_systemSupportsLeapSeconds = SystemSupportsLeapSeconds()
 

Properties

static ReadOnlySpan< byte > DaysInMonth365 [get]
 
static ReadOnlySpan< byte > DaysInMonth366 [get]
 
ulong UTicks [get]
 
ulong InternalKind [get]
 
DateTime Date [get]
 
int Day [get]
 
DayOfWeek DayOfWeek [get]
 
int DayOfYear [get]
 
int Hour [get]
 
DateTimeKind Kind [get]
 
int Millisecond [get]
 
int Minute [get]
 
int Month [get]
 
static DateTime Now [get]
 
int Second [get]
 
long Ticks [get]
 
TimeSpan TimeOfDay [get]
 
static DateTime Today [get]
 
int Year [get]
 
static TimeSpan IAdditiveIdentity< DateTime, TimeSpan >. AdditiveIdentity [get]
 
static DateTime IMinMaxValue< DateTime >. MinValue [get]
 
static DateTime IMinMaxValue< DateTime >. MaxValue [get]
 
static unsafe DateTime UtcNow [get]
 

Private Member Functions

 DateTime (ulong dateData)
 
void ValidateLeapSecond ()
 
 DateTime (SerializationInfo info, StreamingContext context)
 
DateTime Add (double value, int scale)
 
int GetDatePart (int part)
 

Static Private Member Functions

static void ThrowTicksOutOfRange ()
 
static void ThrowInvalidKind ()
 
static void ThrowMillisecondOutOfRange ()
 
static void ThrowDateArithmetic (int param)
 
static ulong DateToTicks (int year, int month, int day)
 
static uint DaysToYear (uint year)
 
static ulong TimeToTicks (int hour, int minute, int second)
 
static double TicksToOADate (long value)
 
static Exception InvalidCast (string to)
 
static unsafe bool SystemSupportsLeapSeconds ()
 
static unsafe DateTime FromFileTimeLeapSecondsAware (ulong fileTime)
 
static unsafe ulong ToFileTimeLeapSecondsAware (long ticks)
 
static DateTime CreateDateTimeFromSystemTime (in Interop.Kernel32.SYSTEMTIME time, ulong hundredNanoSecond)
 
static unsafe delegate *unmanaged[SuppressGCTransition]< ulong *, void > GetGetSystemTimeAsFileTimeFnPtr ()
 
static unsafe DateTime UpdateLeapSecondCacheAndReturnUtcNow ()
 

Private Attributes

readonly ulong _dateData
 

Static Private Attributes

static readonly uint[] s_daysToMonth365
 
static readonly uint[] s_daysToMonth366
 
static unsafe readonly delegate *unmanaged[SuppressGCTransition]< ulong *, void > s_pfnGetSystemTimeAsFileTime = GetGetSystemTimeAsFileTimeFnPtr()
 
static LeapSecondCache s_leapSecondCache = new LeapSecondCache()
 

Detailed Description

Definition at line 14 of file DateTime.cs.


The documentation for this struct was generated from the following file: