Class TimeConverter


  • public class TimeConverter
    extends Object
    Dates reader/writer.
    Since:
    11.0
    Author:
    Luc Maisonobe
    • Constructor Detail

      • TimeConverter

        public TimeConverter​(TimeScale timeScale,
                             AbsoluteDate referenceDate)
        Build a time system.
        Parameters:
        timeScale - base time scale
        referenceDate - reference date for relative dates (may be null if no relative dates are used)
    • Method Detail

      • parse

        public AbsoluteDate parse​(String s)
        Parse a relative or absolute date.
        Parameters:
        s - string to parse
        Returns:
        parsed date
      • components

        public DateTimeComponents components​(AbsoluteDate date)
        Generate calendar components.
        Parameters:
        date - date to convert
        Returns:
        date components
      • offset

        public double offset​(AbsoluteDate date)
        Generate relative offset.
        Parameters:
        date - date to convert
        Returns:
        relative offset
      • getTimeScale

        public TimeScale getTimeScale()
        Get the base time scale.
        Returns:
        base time scale
      • getReferenceDate

        public AbsoluteDate getReferenceDate()
        Get the reference date for relative dates (may be null if no relative dates are used).
        Returns:
        reference date for relative dates (may be null if no relative dates are used)
        Since:
        12.0