Table of Contents

Struct UnixTime

Namespace
Glitch9

A long value that acts as a DateTime object. (DateTime을 가장한 long 값)

[Serializable]
public struct UnixTime : IComparable<UnixTime>, IEquatable<UnixTime>
Implements
Inherited Members
Extension Methods

Constructors

UnixTime(DateTime, bool)

public UnixTime(DateTime dateTime, bool toUniversalTime = true)

Parameters

dateTime DateTime
toUniversalTime bool

UnixTime(int, int, int)

public UnixTime(int year, int month, int day)

Parameters

year int
month int
day int

UnixTime(int, int, int, int, int, int)

public UnixTime(int year, int month, int day, int hour, int minute, int second)

Parameters

year int
month int
day int
hour int
minute int
second int

UnixTime(long)

public UnixTime(long unixTimestamp)

Parameters

unixTimestamp long

UnixTime(string)

public UnixTime(string dateAsString)

Parameters

dateAsString string

Fields

UnixEpoch

public static readonly DateTime UnixEpoch

Field Value

DateTime

Properties

Date

public readonly UnixTime Date { get; }

Property Value

UnixTime

Day

public readonly int Day { get; }

Property Value

int

Default

public static UnixTime Default { get; }

Property Value

UnixTime

Empty

public static UnixTime Empty { get; }

Property Value

UnixTime

Hour

public readonly int Hour { get; }

Property Value

int

IsEmpty

public readonly bool IsEmpty { get; }

Property Value

bool

MaxValue

public static UnixTime MaxValue { get; }

Property Value

UnixTime

MinValue

public static UnixTime MinValue { get; }

Property Value

UnixTime

Minute

public readonly int Minute { get; }

Property Value

int

Month

public readonly int Month { get; }

Property Value

int

Now

public static UnixTime Now { get; }

Property Value

UnixTime

Second

public readonly int Second { get; }

Property Value

int

Today

public static UnixTime Today { get; }

Property Value

UnixTime

Value

public long Value { get; }

Property Value

long

Year

public readonly int Year { get; }

Property Value

int

Methods

Add(UnixTime)

public readonly TimeSpan Add(UnixTime b)

Parameters

b UnixTime

Returns

TimeSpan

AddDays(long)

public readonly UnixTime AddDays(long days)

Parameters

days long

Returns

UnixTime

AddHours(long)

public readonly UnixTime AddHours(long hours)

Parameters

hours long

Returns

UnixTime

AddMinutes(long)

public readonly UnixTime AddMinutes(long minutes)

Parameters

minutes long

Returns

UnixTime

AddSeconds(long)

public UnixTime AddSeconds(long seconds)

Parameters

seconds long

Returns

UnixTime

Compare(UnixTime, UnixTime)

public static int Compare(UnixTime a, UnixTime b)

Parameters

a UnixTime
b UnixTime

Returns

int

CompareTo(UnixTime)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public readonly int CompareTo(UnixTime other)

Parameters

other UnixTime

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

CompareTo(DateTime)

public readonly int CompareTo(DateTime other)

Parameters

other DateTime

Returns

int

CompareTo(long)

public readonly int CompareTo(long other)

Parameters

other long

Returns

int

Equals(UnixTime)

Indicates whether the current object is equal to another object of the same type.

public readonly bool Equals(UnixTime other)

Parameters

other UnixTime

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override readonly bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override readonly int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Subtract(UnixTime)

public readonly TimeSpan Subtract(UnixTime b)

Parameters

b UnixTime

Returns

TimeSpan

ToDateTime()

public readonly DateTime ToDateTime()

Returns

DateTime

ToLocalTime()

public readonly DateTime ToLocalTime()

Returns

DateTime

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

ToString(string)

public readonly string ToString(string format)

Parameters

format string

Returns

string

Operators

operator +(UnixTime, UnixTime)

public static TimeSpan operator +(UnixTime a, UnixTime b)

Parameters

a UnixTime
b UnixTime

Returns

TimeSpan

operator ==(UnixTime, UnixTime)

public static bool operator ==(UnixTime a, UnixTime b)

Parameters

a UnixTime
b UnixTime

Returns

bool

explicit operator DateTime(UnixTime)

public static explicit operator DateTime(UnixTime unixTime)

Parameters

unixTime UnixTime

Returns

DateTime

operator >(UnixTime, UnixTime)

public static bool operator >(UnixTime a, UnixTime b)

Parameters

a UnixTime
b UnixTime

Returns

bool

operator >=(UnixTime, UnixTime)

public static bool operator >=(UnixTime a, UnixTime b)

Parameters

a UnixTime
b UnixTime

Returns

bool

implicit operator long(UnixTime)

public static implicit operator long(UnixTime unixTime)

Parameters

unixTime UnixTime

Returns

long

implicit operator UnixTime(DateTime)

public static implicit operator UnixTime(DateTime dateTime)

Parameters

dateTime DateTime

Returns

UnixTime

implicit operator UnixTime(long)

public static implicit operator UnixTime(long unixTimestamp)

Parameters

unixTimestamp long

Returns

UnixTime

operator !=(UnixTime, UnixTime)

public static bool operator !=(UnixTime a, UnixTime b)

Parameters

a UnixTime
b UnixTime

Returns

bool

operator <(UnixTime, UnixTime)

public static bool operator <(UnixTime a, UnixTime b)

Parameters

a UnixTime
b UnixTime

Returns

bool

operator <=(UnixTime, UnixTime)

public static bool operator <=(UnixTime a, UnixTime b)

Parameters

a UnixTime
b UnixTime

Returns

bool

operator -(UnixTime, UnixTime)

public static TimeSpan operator -(UnixTime a, UnixTime b)

Parameters

a UnixTime
b UnixTime

Returns

TimeSpan