Tutorials 4.0 Dates : Différence entre versions

De Wiki
Aller à : navigation, rechercher
m (Admin a déplacé la page Tutorials 4.0 : Dates vers Tutorials 4.0 Dates sans laisser de redirection)
 
(3 révisions intermédiaires par le même utilisateur non affichées)
Ligne 9 : Ligne 9 :
 
'''Code example:''' [[CreateDates|create dates]]
 
'''Code example:''' [[CreateDates|create dates]]
  
[[Category:Tutorials]]
+
[[Category:Tutorials 4.0]]

Version actuelle en date du 27 mars 2018 à 14:00

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