Parsing Dates and Times
|Top Previous Next|
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.
FreeFlyer 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.
The 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:
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.
The table below describes the epoch systems available in FreeFlyer.
The 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.
The 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.
•TimeTools Properties and Methods
•TimeSpan Properties and Methods
•TimeSpanArray Properties and Methods