Date

From REALbasicWiki

Jump to: navigation, search

Contents

[edit] Description

A Date represents a date and time. The epoch of a REALbasic date is 1904-01-01 00:00:00.

[edit] Superclass

Date inherits from Object.

[edit] Interfaces

None.

[edit] Constants

[edit] Methods

[edit] Sub Constructor()

Date has a default no-parameters constructor, but it is unclear what it actually does; it does not appear to change the state of a Date object.

[edit] Sub Constructor(d as Date)

This is a copy constructor that creates a new Date object with the same state as that of the parameter d, if d is not nil. If d is nil, the result is a Date object initialized to the current date and time.

[edit] Function Operator_Compare(d as Date) as Integer

Operator_Compare overloads the default object comparison for Date. It returns -1 if the argument d is a later date, 1 if the argument d is an earlier date, and 0 if the Dates are the same. It returns 1 if d is nil. The result of calling Operator_Compare on a nil Date reference is idiosyncratic; see Operator_Compare.


[edit] Properties

[edit] SQLDate as String

Set or get the date in ISO 8601 format yyyy-mm-dd. Assigning a bad value will result in an UnsupportedFormatException. The empty string "" is a bad value.

[edit] SQLDateTime as String

Set or get the date and time in ISO 8601 format yyyy-mm-dd hh:mm-ss. Assigning a bad value will result in an UnsupportedFormatException. The empty string "" is a bad value.

[edit] TotalSeconds as Double

This is number of seconds since 1904-01-01 00:00:00. It is the fundamental state of a Date object.

[edit] Events

None.

[edit] Discussion

[edit] Sample Code

Function AussieDate(Extends d as date) As string

 if d = nil then Return ""
 Return str(d.Day)+"/"+str(d.Month)+"/"+format(d.Year, "0000")

End Function

[edit] See Also

Date References

[Aussie]

Personal tools
related