Tutorials 4.5.1 Dates : Différence entre versions
De Wiki
Ligne 7 : | Ligne 7 : | ||
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:''' [[CreateDates_4. | + | '''Code example:''' [[CreateDates_4.5.1|create dates]] |
Since the V4.5.1, some nex urtilities may easily convert Julian dates to [{{JavaDoc4.5.1}}/fr/cnes/sirius/patrius/time/AbsoluteDate.html AbsoluteDate]. | Since the V4.5.1, some nex urtilities may easily convert Julian dates to [{{JavaDoc4.5.1}}/fr/cnes/sirius/patrius/time/AbsoluteDate.html AbsoluteDate]. |
Version actuelle en date du 17 août 2020 à 08:41
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
Since the V4.5.1, some nex urtilities may easily convert Julian dates to AbsoluteDate.
Code example: Julian dates