« Tutorials 4.4 Dates » : différence entre les versions
Aller à la navigation
Aller à la recherche
Page créée avec « == What is a date ? == A date is an instance of [{{JavaDoc4.1}}/fr/cnes/sirius/patrius/time/AbsoluteDate.html AbsoluteDate]. Two important things are necessary to know: *... » |
|||
| Ligne 1 : | Ligne 1 : | ||
== What is a date ? == | == What is a date ? == | ||
A date is an instance of [{{JavaDoc4. | A date is an instance of [{{JavaDoc4.4}}/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 ([{{JavaDoc4. | * 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.4}}/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>) ... | ||
Dernière version du 3 octobre 2019 à 11:28
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