Parsing Dates and Times |
Top Previous Next |
This page covers the FreeFlyer features for working with dates and times. For related topics, see the TimeSpans page and the Timing Precision Modes page.
Note: All epochs that are specified with a numeric value are treated as TAI by default, and all epochs that are specified with strings are UTC by default.
Handling Calendar EpochsFreeFlyer provides the TimeSpan.ConvertToCalendarDate() and String.ParseCalendarDate() methods for easily converting epochs between a numerical value and a calendar-formatted string.
These methods also allow you to specify custom calendar date formats, and you can embed text within the date/time format using double asterisks, as shown below:
The TimeTools object discussed below provides many additional time conversion utilities.
Note: As of FreeFlyer 7.3, the default timing precision mode is nanosecond precision mode. For older Mission Plans that have not yet been converted from millisecond precision mode, the syntax for working with epochs and calendar date/time strings is different. A few samples are shown below; see the timing precision mode page for more information.
TimeToolsThe TimeTools object allows the user to convert epochs to different time systems, convert between numerical time values and calendar-formatted strings, handle time zones, and check for special circumstances like leap years and daylight savings time.
The examples below use the following objects:
TimeTools examples:
Note: As of FreeFlyer 7.3, the default timing precision mode is nanosecond precision mode. For older Mission Plans that have not yet been converted from millisecond precision mode, the TimeTools object uses Variables to represent time values, instead of TimeSpan objects. See the timing precision mode page for more information.
Epoch SystemsThe table below describes the epoch systems available in FreeFlyer.
Reference DatesThe reference dates that can be used with the TimeTools object are listed in the table below.
Note: The GPS time system has a constant offset of 19 seconds from TAI; this happens to be coincident with UTC at the GPS reference epoch. Reference: GPS: Theory and Practice 5th ed., Hofmann-Wellenhof, Lichtenegger, Collins.
Date and Time Format SpecifiersThe FreeFlyer features that can convert between numerical time values and calendar-formatted strings as discussed above all support the date and time string format specifiers listed below. For variable-length date and time specifiers in the third table below, an additional Example column is present to give you an example that can be copied and pasted directly into FreeFlyer that will work. With these variable-length date and time specifiers, the number of characters following the decimal denotes the desired precision and the [+] indicates where additional characters can be added to extend the format as desired. For example, "DOY.DDDDD" would retrieve the 3-digit leading-zero-padded Day Of Year with fraction of day out to five decimal places.
See Also•TimeTools Properties and Methods •TimeSpan Properties and Methods •TimeSpanArray Properties and Methods
|