Tutorials 4.1 Dates : Différence entre versions
De Wiki
(Page créée avec « == What is a date ? == A date is an instance of [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/time/AbsoluteDate.html AbsoluteDate]. Two important things are necessary to... ») |
|||
Ligne 1 : | Ligne 1 : | ||
== What is a date ? == | == What is a date ? == | ||
− | A date is an instance of [{{ | + | A date is an instance of [{{JavaDoc4.1}}/fr/cnes/sirius/patrius/time/AbsoluteDate.html AbsoluteDate]. Two important things are necessary to know: |
* It is an immutable object, meaning, once it is created, it is no more possible to change it. If you want, for example to shift it, you will have to create a new date, eventually starting from the initial one using the <font color=#4169E1>shiftedBy()</font> method; | * It is an immutable object, meaning, once it is created, it is no more possible to change it. If you want, for example to shift it, you will have to create a new date, eventually starting from the initial one using the <font color=#4169E1>shiftedBy()</font> method; | ||
− | * It is allways "stored" in the <font color=#FF8C00 title="Temps Atomique International>TAI</font> time scale (but may be built and/or expressed in other formats). Time scales are available with a factory ([{{ | + | * It is allways "stored" in the <font color=#FF8C00 title="Temps Atomique International>TAI</font> time scale (but may be built and/or expressed in other formats). Time scales are available with a factory ([{{JavaDoc4.1}}/fr/cnes/sirius/patrius/time/TimeScalesFactory.html TimeScalesFactory].getXXX()). But, be careful that it is mandatory to use a <font color=#556B2F>'''PATRIUS'''</font> data set as <font color=#FF8C00 title="Coordinated universal time>UTC</font>/<font color=#FF8C00 title="Temps Atomique International>TAI</font> shifts are stored in it ! |
Some basic operations may be executed as, for example, comparizon (<font color=#4169E1>compareTo()</font>), computing a duration (<font color=#4169E1>durationFrom()</font>), adding an offset (<font color=#4169E1>shiftedBy()</font>) ... | Some basic operations may be executed as, for example, comparizon (<font color=#4169E1>compareTo()</font>), computing a duration (<font color=#4169E1>durationFrom()</font>), adding an offset (<font color=#4169E1>shiftedBy()</font>) ... | ||
− | '''Code example:''' [[ | + | '''Code example:''' [[CreateDates_4.1|create dates]] |
[[Category:Tutorials 4.1]] | [[Category:Tutorials 4.1]] |
Version actuelle en date du 20 décembre 2018 à 15:38
What is a date ?
A date is an instance of AbsoluteDate. Two important things are necessary to know:
- It is an immutable object, meaning, once it is created, it is no more possible to change it. If you want, for example to shift it, you will have to create a new date, eventually starting from the initial one using the shiftedBy() method;
- It is allways "stored" in the TAI time scale (but may be built and/or expressed in other formats). Time scales are available with a factory (TimeScalesFactory.getXXX()). But, be careful that it is mandatory to use a PATRIUS data set as UTC/TAI shifts are stored in it !
Some basic operations may be executed as, for example, comparizon (compareTo()), computing a duration (durationFrom()), adding an offset (shiftedBy()) ...
Code example: create dates