DateTime
Overview
DateTime type used to store and work with date/time values.
Location
- Reference: Island.fx
- Namespace: RemObjects.Elements.System
- Ancestry: ValueType | DateTime
constructor
constructor
DateTime()
init()
DateTime()
Sub New()
constructor (Int64)
constructor(aTicks: Int64)
DateTime(Int64 aTicks)
init(_ aTicks: Int64)
DateTime(Int64 aTicks)
Sub New(aTicks As Int64)
Parameters:
- aTicks:
Parameters:
- aYear:
- aMonth:
- aDay:
Parameters:
- aYear:
- aMonth:
- aDay:
- anHour:
- aMinute:
constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32; aSecond: Int32)
Parameters:
- aYear:
- aMonth:
- aDay:
- anHour:
- aMinute:
- aSecond:
constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32; aSecond: Int32; aMillisecond: Int32)
DateTime(Int32 aYear, Int32 aMonth, Int32 aDay, Int32 anHour, Int32 aMinute, Int32 aSecond, Int32 aMillisecond)
init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32, _ anHour: Int32, _ aMinute: Int32, _ aSecond: Int32, _ aMillisecond: Int32)
Parameters:
- aYear:
- aMonth:
- aDay:
- anHour:
- aMinute:
- aSecond:
- aMillisecond:
AddDays
Adds a nr of days and returns a new datetime.
Parameters:
- Value:
AddHours
Adds a nr of hours and returns a new datetime.
Parameters:
- Value:
AddMilliseconds
Adds a nr of msec and returns a new datetime.
Parameters:
- Value:
AddMinutes
Adds a nr of minutes and returns a new datetime.
Parameters:
- Value:
AddMonths
Adds a nr of months and returns a new datetime.
Parameters:
- Value:
AddSeconds
Adds a nr of seconds and returns a new datetime.
Parameters:
- Value:
AddTicks
Adds a nr of ticks and returns a new datetime.
Parameters:
- Value:
AddYears
Adds a nr of years and returns a new datetime.
Parameters:
- Value:
Parameters:
- a:
Compares this date, and returns 0 if the same, -1 if less, 1 if more.
Parameters:
- Value:
Date
Returns the date without time part.
property Date: DateTime read;
DateTime Date { get; }
var Date: DateTime { get{} }
DateTime Date { __get; }
ReadOnly Property Date() As DateTime
Day
Returns the day of the month (1..31)
property Day: Int32 read;
Int32 Day { get; }
var Day: Int32 { get{} }
Int32 Day { __get; }
ReadOnly Property Day() As Int32
DayOfWeek
Returns the day of the week (1..7)
property DayOfWeek: Int32 read;
Int32 DayOfWeek { get; }
var DayOfWeek: Int32 { get{} }
Int32 DayOfWeek { __get; }
ReadOnly Property DayOfWeek() As Int32
Default constructor.
Parameters:
- aOther: the reference to compare this with.
Returns true if the target object matches this one, by default compares the reference.
Parameters:
- obj:
Finalize protected virtual (declared in Object)
method Finalize
void Finalize()
func Finalize()
void Finalize()
Sub Finalize()
FromFileTime Windows
Converts a windows filetime to datetime.
class method FromFileTime(aFileTime: FILETIME): DateTime
static DateTime FromFileTime(FILETIME aFileTime)
static func FromFileTime(_ aFileTime: FILETIME) -> DateTime
static DateTime FromFileTime(FILETIME aFileTime)
Shared Function FromFileTime(aFileTime As FILETIME) As DateTime
Parameters:
- aFileTime:
FromOleDate
Converts an OLE date (double) to DateTime.
Parameters:
- aDate:
FromSystemTime Windows
Converts a windows system time to Datetime.
class method FromSystemTime(aFileTime: SYSTEMTIME): DateTime
static DateTime FromSystemTime(SYSTEMTIME aFileTime)
static func FromSystemTime(_ aFileTime: SYSTEMTIME) -> DateTime
static DateTime FromSystemTime(SYSTEMTIME aFileTime)
Shared Function FromSystemTime(aFileTime As SYSTEMTIME) As DateTime
Parameters:
- aFileTime:
FromUnixTime Android, Fuchsia, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, visionOS, visionOS Simulator, watchOS, watchOS Simulator
Converts a unix timestamp to Datetime.
class method FromUnixTime(aStruct: __struct_timespec): DateTime
static DateTime FromUnixTime(__struct_timespec aStruct)
static func FromUnixTime(_ aStruct: __struct_timespec) -> DateTime
static DateTime FromUnixTime(__struct_timespec aStruct)
Shared Function FromUnixTime(aStruct As __struct_timespec) As DateTime
Parameters:
- aStruct:
FromUnixTimeUTC Android, Fuchsia, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, visionOS, visionOS Simulator, watchOS, watchOS Simulator
Converts a unix timestamp to Datetime, presume in UTC.
class method FromUnixTimeUTC(aStruct: __struct_timespec): DateTime
static DateTime FromUnixTimeUTC(__struct_timespec aStruct)
static func FromUnixTimeUTC(_ aStruct: __struct_timespec) -> DateTime
static DateTime FromUnixTimeUTC(__struct_timespec aStruct)
Shared Function FromUnixTimeUTC(aStruct As __struct_timespec) As DateTime
Parameters:
- aStruct:
GetHashCode virtual (declared in Object)
Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.
method GetHashCode: Int32
Int32 GetHashCode()
func GetHashCode() -> Int32
Int32 GetHashCode()
Function GetHashCode() As Int32
GetType (declared in Object)
Returns the actual type of this class
method GetType: Type
Type GetType()
func GetType() -> Type
Type GetType()
Function GetType() As Type
Hour
Returns the hour (0..23)
property Hour: Int32 read;
Int32 Hour { get; }
var Hour: Int32 { get{} }
Int32 Hour { __get; }
ReadOnly Property Hour() As Int32
isLeapYear
Check if the year is a leap year.
Parameters:
- Value:
MaxYear
Max year.
const MaxYear: Int32 = 10000;
const Int32 MaxYear = 10000
static let MaxYear: Int32 = 10000
static final Int32 MaxYear = 10000
Dim MaxYear As Int32 = 10000
Milliseconds
Returns the miliseconds in this datetime.
property Milliseconds: Int32 read;
Int32 Milliseconds { get; }
var Milliseconds: Int32 { get{} }
Int32 Milliseconds { __get; }
ReadOnly Property Milliseconds() As Int32
Minute
Returns the minutes in this datetime.
property Minute: Int32 read;
Int32 Minute { get; }
var Minute: Int32 { get{} }
Int32 Minute { __get; }
ReadOnly Property Minute() As Int32
Month
Returns the month in this datetime.
property Month: Int32 read;
Int32 Month { get; }
var Month: Int32 { get{} }
Int32 Month { __get; }
ReadOnly Property Month() As Int32
Now
Returns the current DateTime.
class property Now: DateTime read;
class DateTime Now { get; }
static var Now: DateTime { get{} }
class DateTime Now { __get; }
Shared ReadOnly Property Now() As DateTime
ReferenceEquals (declared in Object)
Compares two references for equivalence (even if they have an equals operator)
Parameters:
- a: left value
- b: right value
Second
Returns the seconds in this datetime.
property Second: Int32 read;
Int32 Second { get; }
var Second: Int32 { get{} }
Int32 Second { __get; }
ReadOnly Property Second() As Int32
Ticks
Returns the datetime as Ticks.
property Ticks: Int64 read;
Int64 Ticks { get; }
var Ticks: Int64 { get{} }
Int64 Ticks { __get; }
ReadOnly Property Ticks() As Int64
Today
Returns the current date without time part.
class property Today: DateTime read;
class DateTime Today { get; }
static var Today: DateTime { get{} }
class DateTime Today { __get; }
Shared ReadOnly Property Today() As DateTime
ToLongPrettyDateString
Parameters:
- aTimeZone:
ToOleDate
Convert a datetime to Ole date (double).
Parameters:
- aDate:
ToShortDateString
Parameters:
- aTimeZone:
ToShortPrettyDateString
Parameters:
- aTimeZone:
ToShortTimeString
Parameters:
- aTimeZone:
ToString override virtual
Convert this datetime to string.
method ToString: String
String ToString()
func ToString() -> String
String ToString()
Function ToString() As String
Parameters:
- aTimeZone:
Parameters:
- Format:
- aLocale:
- aTimeZone:
Parameters:
- Format:
- aTimeZone:
Parameters:
- Format:
- Culture:
- aTimeZone:
ToSystemTime Windows
Convert this value to a System datetime.
method ToSystemTime: SYSTEMTIME
SYSTEMTIME ToSystemTime()
func ToSystemTime() -> SYSTEMTIME
SYSTEMTIME ToSystemTime()
Function ToSystemTime() As SYSTEMTIME
ToSystemTime (DateTime): SYSTEMTIME Windows
Convert this value to a System datetime.
class method ToSystemTime(aDateTime: DateTime): SYSTEMTIME
static SYSTEMTIME ToSystemTime(DateTime aDateTime)
static func ToSystemTime(_ aDateTime: DateTime) -> SYSTEMTIME
static SYSTEMTIME ToSystemTime(DateTime aDateTime)
Shared Function ToSystemTime(aDateTime As DateTime) As SYSTEMTIME
Parameters:
- aDateTime:
class method TryParse(aDateTime: String; aFormat: String; aLocale: Locale; aOptions: DateParserOptions): nullable DateTime
static DateTime? TryParse(String aDateTime, String aFormat, Locale aLocale, DateParserOptions aOptions)
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime!
Parameters:
- aDateTime:
- aFormat:
- aLocale:
- aOptions:
class method TryParse(aDateTime: String; aFormat: String; aOptions: DateParserOptions): nullable DateTime
Parameters:
- aDateTime:
- aFormat:
- aOptions:
class method TryParse(aDateTime: String; aLocale: Locale; aOptions: DateParserOptions): nullable DateTime
Parameters:
- aDateTime:
- aLocale:
- aOptions:
Parameters:
- aDateTime:
- aOptions:
TryParseISO8601
Parameters:
- aDateTime:
UtcNow
Returns the current UTC datetime.
class property UtcNow: DateTime read;
class DateTime UtcNow { get; }
static var UtcNow: DateTime { get{} }
class DateTime UtcNow { __get; }
Shared ReadOnly Property UtcNow() As DateTime
Year
Returns the year in this Datetime.
MaxYear
Max year.
Date
Returns the date without time part.
property Date: DateTime read;
DateTime Date { get; }
var Date: DateTime { get{} }
DateTime Date { __get; }
ReadOnly Property Date() As DateTime
Day
Returns the day of the month (1..31)
property Day: Int32 read;
Int32 Day { get; }
var Day: Int32 { get{} }
Int32 Day { __get; }
ReadOnly Property Day() As Int32
DayOfWeek
Returns the day of the week (1..7)
property DayOfWeek: Int32 read;
Int32 DayOfWeek { get; }
var DayOfWeek: Int32 { get{} }
Int32 DayOfWeek { __get; }
ReadOnly Property DayOfWeek() As Int32
Hour
Returns the hour (0..23)
property Hour: Int32 read;
Int32 Hour { get; }
var Hour: Int32 { get{} }
Int32 Hour { __get; }
ReadOnly Property Hour() As Int32
Milliseconds
Returns the miliseconds in this datetime.
property Milliseconds: Int32 read;
Int32 Milliseconds { get; }
var Milliseconds: Int32 { get{} }
Int32 Milliseconds { __get; }
ReadOnly Property Milliseconds() As Int32
Minute
Returns the minutes in this datetime.
property Minute: Int32 read;
Int32 Minute { get; }
var Minute: Int32 { get{} }
Int32 Minute { __get; }
ReadOnly Property Minute() As Int32
Month
Returns the month in this datetime.
property Month: Int32 read;
Int32 Month { get; }
var Month: Int32 { get{} }
Int32 Month { __get; }
ReadOnly Property Month() As Int32
Second
Returns the seconds in this datetime.
property Second: Int32 read;
Int32 Second { get; }
var Second: Int32 { get{} }
Int32 Second { __get; }
ReadOnly Property Second() As Int32
Ticks
Returns the datetime as Ticks.
property Ticks: Int64 read;
Int64 Ticks { get; }
var Ticks: Int64 { get{} }
Int64 Ticks { __get; }
ReadOnly Property Ticks() As Int64
Year
Returns the year in this Datetime.
property Year: Int32 read;
Int32 Year { get; }
var Year: Int32 { get{} }
Int32 Year { __get; }
ReadOnly Property Year() As Int32
Now
Returns the current DateTime.
class property Now: DateTime read;
class DateTime Now { get; }
static var Now: DateTime { get{} }
class DateTime Now { __get; }
Shared ReadOnly Property Now() As DateTime
Today
Returns the current date without time part.
class property Today: DateTime read;
class DateTime Today { get; }
static var Today: DateTime { get{} }
class DateTime Today { __get; }
Shared ReadOnly Property Today() As DateTime
UtcNow
Returns the current UTC datetime.
FromFileTime Windows
Converts a windows filetime to datetime.
class method FromFileTime(aFileTime: FILETIME): DateTime
static DateTime FromFileTime(FILETIME aFileTime)
static func FromFileTime(_ aFileTime: FILETIME) -> DateTime
static DateTime FromFileTime(FILETIME aFileTime)
Shared Function FromFileTime(aFileTime As FILETIME) As DateTime
Parameters:
- aFileTime:
FromOleDate
Converts an OLE date (double) to DateTime.
Parameters:
- aDate:
FromSystemTime Windows
Converts a windows system time to Datetime.
class method FromSystemTime(aFileTime: SYSTEMTIME): DateTime
static DateTime FromSystemTime(SYSTEMTIME aFileTime)
static func FromSystemTime(_ aFileTime: SYSTEMTIME) -> DateTime
static DateTime FromSystemTime(SYSTEMTIME aFileTime)
Shared Function FromSystemTime(aFileTime As SYSTEMTIME) As DateTime
Parameters:
- aFileTime:
FromUnixTime Android, Fuchsia, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, visionOS, visionOS Simulator, watchOS, watchOS Simulator
Converts a unix timestamp to Datetime.
class method FromUnixTime(aStruct: __struct_timespec): DateTime
static DateTime FromUnixTime(__struct_timespec aStruct)
static func FromUnixTime(_ aStruct: __struct_timespec) -> DateTime
static DateTime FromUnixTime(__struct_timespec aStruct)
Shared Function FromUnixTime(aStruct As __struct_timespec) As DateTime
Parameters:
- aStruct:
FromUnixTimeUTC Android, Fuchsia, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, visionOS, visionOS Simulator, watchOS, watchOS Simulator
Converts a unix timestamp to Datetime, presume in UTC.
class method FromUnixTimeUTC(aStruct: __struct_timespec): DateTime
static DateTime FromUnixTimeUTC(__struct_timespec aStruct)
static func FromUnixTimeUTC(_ aStruct: __struct_timespec) -> DateTime
static DateTime FromUnixTimeUTC(__struct_timespec aStruct)
Shared Function FromUnixTimeUTC(aStruct As __struct_timespec) As DateTime
Parameters:
- aStruct:
isLeapYear
Check if the year is a leap year.
Parameters:
- Value:
ReferenceEquals (declared in Object)
Compares two references for equivalence (even if they have an equals operator)
Parameters:
- a: left value
- b: right value
ToOleDate
Convert a datetime to Ole date (double).
Parameters:
- aDate:
ToSystemTime (DateTime): SYSTEMTIME Windows
Convert this value to a System datetime.
class method ToSystemTime(aDateTime: DateTime): SYSTEMTIME
static SYSTEMTIME ToSystemTime(DateTime aDateTime)
static func ToSystemTime(_ aDateTime: DateTime) -> SYSTEMTIME
static SYSTEMTIME ToSystemTime(DateTime aDateTime)
Shared Function ToSystemTime(aDateTime As DateTime) As SYSTEMTIME
Parameters:
- aDateTime:
class method TryParse(aDateTime: String; aFormat: String; aLocale: Locale; aOptions: DateParserOptions): nullable DateTime
static DateTime? TryParse(String aDateTime, String aFormat, Locale aLocale, DateParserOptions aOptions)
static func TryParse(_ aDateTime: String, _ aFormat: String, _ aLocale: Locale, _ aOptions: DateParserOptions) -> DateTime!
Parameters:
- aDateTime:
- aFormat:
- aLocale:
- aOptions:
class method TryParse(aDateTime: String; aFormat: String; aOptions: DateParserOptions): nullable DateTime
Parameters:
- aDateTime:
- aFormat:
- aOptions:
class method TryParse(aDateTime: String; aLocale: Locale; aOptions: DateParserOptions): nullable DateTime
Parameters:
- aDateTime:
- aLocale:
- aOptions:
Parameters:
- aDateTime:
- aOptions:
TryParseISO8601
Parameters:
- aDateTime:
constructor
constructor
DateTime()
init()
DateTime()
Sub New()
constructor (Int64)
constructor(aTicks: Int64)
DateTime(Int64 aTicks)
init(_ aTicks: Int64)
DateTime(Int64 aTicks)
Sub New(aTicks As Int64)
Parameters:
- aTicks:
Parameters:
- aYear:
- aMonth:
- aDay:
Parameters:
- aYear:
- aMonth:
- aDay:
- anHour:
- aMinute:
constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32; aSecond: Int32)
Parameters:
- aYear:
- aMonth:
- aDay:
- anHour:
- aMinute:
- aSecond:
constructor(aYear: Int32; aMonth: Int32; aDay: Int32; anHour: Int32; aMinute: Int32; aSecond: Int32; aMillisecond: Int32)
DateTime(Int32 aYear, Int32 aMonth, Int32 aDay, Int32 anHour, Int32 aMinute, Int32 aSecond, Int32 aMillisecond)
init(_ aYear: Int32, _ aMonth: Int32, _ aDay: Int32, _ anHour: Int32, _ aMinute: Int32, _ aSecond: Int32, _ aMillisecond: Int32)
Parameters:
- aYear:
- aMonth:
- aDay:
- anHour:
- aMinute:
- aSecond:
- aMillisecond:
AddDays
Adds a nr of days and returns a new datetime.
Parameters:
- Value:
AddHours
Adds a nr of hours and returns a new datetime.
Parameters:
- Value:
AddMilliseconds
Adds a nr of msec and returns a new datetime.
Parameters:
- Value:
AddMinutes
Adds a nr of minutes and returns a new datetime.
Parameters:
- Value:
AddMonths
Adds a nr of months and returns a new datetime.
Parameters:
- Value:
AddSeconds
Adds a nr of seconds and returns a new datetime.
Parameters:
- Value:
AddTicks
Adds a nr of ticks and returns a new datetime.
Parameters:
- Value:
AddYears
Adds a nr of years and returns a new datetime.
Parameters:
- Value:
Parameters:
- a:
Compares this date, and returns 0 if the same, -1 if less, 1 if more.
Parameters:
- Value:
Default constructor.
Parameters:
- aOther: the reference to compare this with.
Returns true if the target object matches this one, by default compares the reference.
Parameters:
- obj:
Finalize protected virtual (declared in Object)
method Finalize
void Finalize()
func Finalize()
void Finalize()
Sub Finalize()
GetHashCode virtual (declared in Object)
Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.
method GetHashCode: Int32
Int32 GetHashCode()
func GetHashCode() -> Int32
Int32 GetHashCode()
Function GetHashCode() As Int32
GetType (declared in Object)
Returns the actual type of this class
method GetType: Type
Type GetType()
func GetType() -> Type
Type GetType()
Function GetType() As Type
ToLongPrettyDateString
Parameters:
- aTimeZone:
ToShortDateString
Parameters:
- aTimeZone:
ToShortPrettyDateString
Parameters:
- aTimeZone:
ToShortTimeString
Parameters:
- aTimeZone:
ToString override virtual
Convert this datetime to string.
method ToString: String
String ToString()
func ToString() -> String
String ToString()
Function ToString() As String
Parameters:
- aTimeZone:
Parameters:
- Format:
- aLocale:
- aTimeZone:
Parameters:
- Format:
- aTimeZone:
Parameters:
- Format:
- Culture:
- aTimeZone:
ToSystemTime Windows
Convert this value to a System datetime.
method ToSystemTime: SYSTEMTIME
SYSTEMTIME ToSystemTime()
func ToSystemTime() -> SYSTEMTIME
SYSTEMTIME ToSystemTime()
Function ToSystemTime() As SYSTEMTIME