OSID Logo
OSID Specifications
calendaring package
Version 3.0.0
Release Candidate Preview
Interfaceosid.calendaring.DateTime
Implementsosid.OsidPrimitive
Description

The DateTime interface defines a date and/or time. This interface provides a very broad range of dates, describes more or less precision, and/or conveys an uncertainty. A number of convenience methods for retrieving time elements are available but only those methods covered by the specified granularity are valid.

A typical example is describing a day where the time isn't known, and the event did not occur at midnight.

                     
                     
                     getMillennium() == 2
                     getCentury() == 18
                     getYear() == 1776
                     getMonth() == 7
                     getDay() == 4
                     getHour() == 0
                     getGranularity() == DateTimeResolution.DAY
                     definesUncertainty() == false
                     
                                 
                     
                

Another example showing that the time is probably 1pm but could have been as late as 3pm or early as noon.

                     
                     
                     getMillennium() == 3
                     getCentury() == 21
                     getYear() == 2008
                     getMonth() == 3
                     getDay() == 17
                     getHour() == 13
                     getMinute() == 0
                     getGranularity() == TimeResolution.MINUTE
                     definesUncertainty() == true
                     getUncertaintyGranularity() == DateTimeResolution.HOUR
                     getUncertaintyMinus() == 1
                     getUncertaintyPlus == 2
                     
                                 
                     
                

An example marking the birth of the universe. 13.73 billion years +/- 120 million years. The granularity suggests that no more resolution than one million years can be inferred from the "clock", making errors in the exact number of millennia insignificant.

                     
                     
                     getEpoch() == -13,730
                     getMillennium() == 0
                     getCentury() == 0
                     getYear() == 0
                     getGranularity() == TimeResolution.EPOCH
                     definesUncertainty() == true
                     getUncertaintyGranularity() == DateTimeResolution.EPOCH
                     getUncertaintyMinus() == 120
                     getUncertaintyPlus == 120
                     
                                 
                     
                
MethodgetCalendarType
Description

Gets the calendar type.

Returnosid.type.Typethe calendar type
CompliancemandatoryThis method must be implemented.
MethodgetAeon
Description

Gets the aeon starting from 1. An aeon is 1B years.

Returnintegerthe aeon
CompliancemandatoryThis method must be implemented.
MethodgetEpoch
Description

Gets the epoch starting from 1. An epoch is 1M years.

Returnintegerthe eposh
CompliancemandatoryThis method must be implemented.
MethodgetMillennium
Description

Gets the millennium starting from 1. A millenium is 1,000 years.

Returnintegerthe millennium
CompliancemandatoryThis method must be implemented.
MethodgetCentury
Description

Gets the century starting from 1.

Returnintegerthe century
CompliancemandatoryThis method must be implemented.
MethodgetYear
Description

Gets the year starting from 1.

Returnintegerthe year
CompliancemandatoryThis method must be implemented.
MethodgetMonth
Description

Gets the month number starting from 1.

Returncardinalthe month
CompliancemandatoryThis method must be implemented.
MethodgetDay
Description

Gets the day of the month starting from 1.

Returncardinalthe day of the month
CompliancemandatoryThis method must be implemented.
MethodgetTimeType
Description

Gets the time type.

Returnosid.type.Typethe time type
CompliancemandatoryThis method must be implemented.
MethodgetHour
Description

Gets the hour of the day 0-23.

Returncardinalthe hour of the day
CompliancemandatoryThis method must be implemented.
MethodgetMinute
Description

Gets the minute of the hour 0-59.

Returncardinalthe minute of the hour
CompliancemandatoryThis method must be implemented.
MethodgetSecond
Description

Gets the second of the minute 0-59.

Returncardinalthe second of the minute
CompliancemandatoryThis method must be implemented.
MethodgetMilliseconds
Description

Gets the number of milliseconds in this second 0-999. A millisecond is one thousandth of a second.

Returncardinalthe milliseconds of the second
CompliancemandatoryThis method must be implemented.
MethodgetMicroseconds
Description

Gets the number of microseconds of the second 0-999. A microsecond is one millionth of a second.

Returncardinalthe micrseconds of the millisecond
CompliancemandatoryThis method must be implemented.
MethodgetNanoseconds
Description

Gets the number of nanoseconds of the microsecond 0-999. A nanosecond is one billionth of a second.

Returncardinalthe nanoseconds of the microsecond
CompliancemandatoryThis method must be implemented.
MethodgetPicoseconds
Description

Gets the number of picoseconds of the nanosecond 0-999. A picosecond is one trillionth of a second.

Returncardinalthe picoseconds of the nanosecond
CompliancemandatoryThis method must be implemented.
MethodgetFemtoseconds
Description

Gets the number of femtoseconds of the picosecond 0-999. A femtosecond is one quadrillionth of a second.

Returncardinalthe femtoseconds of the picosecond
CompliancemandatoryThis method must be implemented.
MethodgetAttoseconds
Description

Gets the number of attoseconds of the femtoseconds 0-999. An attosecond is one quintillionth of a second.

Returncardinalthe attoseconds of the femtosecond
CompliancemandatoryThis method must be implemented.
MethodgetZeptoseconds
Description

Gets the number of zeptoseconds of the attosecond 0-999. A zeptosecond is one sextillionth of a second.

Returncardinalthe zeptoseconds of the attosecond
CompliancemandatoryThis method must be implemented.
MethodgetYoctoseconds
Description

Gets the number of yoctoseconds of the picosecond 0-999. A yoctosecond is one septillionth of a second. This is getting quite small.

Returncardinalthe yoctoseconds of the picosecond
CompliancemandatoryThis method must be implemented.
MethodgetXoxxoseconds
Description

Gets the number of xoxxoseconds of the yoctosecond 0-999. A xoxxosecond is one octillionth of a second. We're going with Rudy Rucker here.

Returncardinalthe xoxxoseconds of the yoctosecond
CompliancemandatoryThis method must be implemented.
MethodgetWeebleseconds
Description

Gets the number of weebleseconds of the xoxxosecond 0-999. A weeblesecond is one nonillionth of a second.

Returncardinalthe weebleseconds of the xoxxoseconds
CompliancemandatoryThis method must be implemented.
MethodgetVatoseconds
Description

Gets the number of vatoseconds of the xoxxosecond 0-999. A vatosecond is one decillionth of a second.

Returncardinalthe vatoseconds of the weeblesecond
CompliancemandatoryThis method must be implemented.
MethodgetUndaseconds
Description

Gets the number of undaseconds of the vatosecond 0-999. An undasecond is one unadecillionth of a second.

Returncardinalthe undaseconds of the vatosecond
CompliancemandatoryThis method must be implemented.
MethodgetPlanckSeconds
Description

Gets the number of Plancks of the vatoseconds. A Planck is 10 quattuordecillionths of a second.

Returncardinalthe plancks of the undasecond
CompliancemandatoryThis method must be implemented.
MethodgetGranularity
Description

Gets the granularity of this time. The granularity indicates the resolution of the clock. More precision than what is specified in this method cannot be inferred from the available data.

Returnosid.calendaring.DateTimeResolutiongranularity
CompliancemandatoryThis method must be implemented.
MethodgetGranularityMultiplier
Description

If the granularity of the time equals getGranularity(), then the multiplier is 1. This method may return a different number when the granularity differs from one of the defined resolutions.

Returncardinalgranularity multiplier
CompliancemandatoryThis method must be implemented.
MethoddefinesUncertainty
Description

Tests if uncertainty is defined for this time.

Returnboolean true if uncertainty is defined, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetUncertaintyUnits
Description

Gets the units of the uncertainty.

Returnosid.calendaring.DateTimeResolutionunits of the uncertainty
ErrorsILLEGAL_STATE definesUncertainty() is false
CompliancemandatoryThis method must be implemented.
MethodgetUncertaintyMinus
Description

Gets the uncertainty of this time in the negative direction.

Returncardinalthe uncertainty under this value
ErrorsILLEGAL_STATE definesUncertainty() is false
CompliancemandatoryThis method must be implemented.
MethodgetUncertaintyPlus
Description

Gets the uncertainty of this time in the positive direction.

Returncardinalthe uncertainty over this value
ErrorsILLEGAL_STATE definesUncertainty() is false
CompliancemandatoryThis method must be implemented.
MethodisUncertaintyDateInclusive
Description

Tests if the uncertainty is inclusive of all dates. An inclusive uncertainty includes the entire range specified by the uncertainty units e.g. +/- 1 year includes all of the months and days within that interval. A non-inclusive uncertainty would mean the year is uncertain but the month and day is certain.

Returnboolean true if the uncertainty includes all dates, false otherwise
ErrorsILLEGAL_STATE definesUncertainty() is false
CompliancemandatoryThis method must be implemented.
MethodisUncertaintyTimeInclusive
Description

Tests if the uncertainty is time inclusive. An inclusive uncertainty includes the entire range specified by the uncertainty units e.g. +/- 1 year includes all of the seconds within that interval. A non-inclusive uncertainty would mean the year is uncertain but the time is certain.

Returnboolean true if the uncertainty includes all times, false otherwise
ErrorsILLEGAL_STATE definesUncertainty() is false
CompliancemandatoryThis method must be implemented.