bool Equals (SDateTime other)
Returns true if the datetimes are same.
int ComparesTo (SDateTime other)
Compares two datetimes and returns an integer. 0 == identical. greater than 0 == This datetime is greater than other. less than 0 == This datetime is less than other.
string FormatLocal (string format)
Outputs a custom formatted string with the date and time according to local language rules.
string FormatGlobal (string format)
Outputs a custom formatted string with the date and time according to global rules (culture invariant).
string Regional (string region)
Outputs a string with the date and time formatted according to specific regional rules.
string FormatRegional (string region, string format)
Outputs a custom formatted string with the date and time according to specific regional rules.
SDateTime AddYears (int amount)
Return a new SDateTime that is the current date time + amount years.
SDateTime AddMonths (int amount)
Return a new SDateTime that is the current date time + amount months.
SDateTime AddDays (double amount)
Return a new SDateTime that is the current date time + amount days.
SDateTime AddHours (double amount)
Return a new SDateTime that is the current date time + amount hours.
SDateTime AddMinutes (double amount)
Return a new SDateTime that is the current date time + amount minutes.
SDateTime AddSeconds (double amount)
Return a new SDateTime that is the current date time + amount seconds.
SDateTime AddMilliseconds (double amount)
Return a new SDateTime that is the current date time + amount milliseconds.
static SDateTime Now()
Creates a new SDateTime object equal to the current local time.
static SDateTime Server ()
Creates a new SDateTime object equal to the current server time.
static SDateTime Parse (string input)
Creates a new SDateTime object by attempting to parse a string input. Returns null/nil if the string cannot be parsed.
static bool IsLeapYear (int year)
Return true if the specified year is a leap year.
static int DaysInMonth (int year, int month)
Return the number of days in the given month for the given year.
int Year get
Get the independent time unit property of the SDateTime object.
int Month get
Property Description
int Day get
Property Description
int Hour get
Property Description
int Minute get
Property Description
int Second get
Property Description
int Millisecond get
Property Description
string Local get
Outputs a string with the date and time formatted according to local language rules.
string Global get
Outputs a string with the date and time formatted according to global rules (culture invariant).
int UnixTime get
Return this time in Unix time, the number of seconds since Jan 1st, 1970.
bool IsDaylightSavingTime get
Indicates whether this instance of DateTime is within the daylight saving time range for the current time zone.
Function Name |
---|
Property Name |
---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
bool Equals (SDateTime other)
int ComparesTo (SDateTime other)
string FormatLocal (string format)
string FormatGlobal (string format)
string Regional (string region)
string FormatRegional (string region, string format)
SDateTime AddYears (int amount)
SDateTime AddMonths (int amount)
SDateTime AddDays (double amount)
SDateTime AddHours (double amount)
SDateTime AddMinutes (double amount)
SDateTime AddSeconds (double amount)
SDateTime AddMilliseconds (double amount)
Static Functions
static SDateTime Now()
static SDateTime Server ()
static SDateTime Parse (string input)
static bool IsLeapYear (int year)
static int DaysInMonth (int year, int month)
int Year get
int Month get
int Day get
int Hour get
int Minute get
int Second get
int Millisecond get
string Local get
string Global get
int UnixTime get
bool IsDaylightSavingTime get
format
string
See below for examples
region
string
region
string
format
string
See below