Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Summary

This section describes the Primordium implementations of org.osid.calendaring.DateTime.

...

Code Block
    /**
     *  Gets an unknown date.
     *
     *  @return an unknown date
     */

    public static org.osid.calendaring.DateTime unknown()

Serialization

toString() will produce the same ISO-like output that can be parsed by valueOf().

Comparison Methods

  • isGreater(org.osid.calendaring.DateTime d) 
  • isLess(org.osid.calendaring.DateTime d)
  • isInclusive(org.osid.calendaring.DateTime d)
  • isExclusive(org.osid.calendaring.DateTime d)

...

thisexternal DateTimeisGreater()isLess()isInclusive()isExclusive()
2010-01-012011-01-01FTFT
20102010-06-06FFTF
2010-06-062010FFFF
2010-12-312010-12-30TFFT

 

Equality

Two DateTimes are equal if their calendar & time types, values within their respective granularities, and uncertainties are also equal. 

...

A DateTime is simply an instance of time. It communicates whatever you feed it, including September 10, 1752. 

...

That 70's Show

A timestamp is a number of clock ticks from a known point in time. While timestamps are fine when recording transactions, they fall short in applications where the dates and times are manually entered or loaded fed from other sources after the fact, or . They might even pertain to events long before there were modern computer databases.

The DateTime interface is a communication vehicle. It communicates what is, and more importantly, what isn't known about a Date and Time. If all we know is the day an event took place, it shouldn't be implied that it must have occurred at midnight. If all we know is the year, it probably didn't really happen on January 1. Or perhaps that was quite a New Year's party.

Granularity provides a way to capture captures what is knownrelevant. Graduates from the class of 1918 were awarded degrees on June 3, but the minutes and seconds of the day are irrelevant. Uncertainty captures what isn't known. A photograph taken circa 1908 (let's say uncertainty +/-1 year) might be apropos for a listing in the "photographs of 1909" search results.

DateTime is just a communication vehicle with some bells, whistles, and too many late nights. Convert it to whatever you want but (just keep in mind that the range on the thing is very very large and someone send you some DateTimes from the "big freeze" – it could happen).

See Also

...