ToIso8601() public static méthode

Converts a JulianDate to an ISO8601 date string.
public static ToIso8601 ( JulianDate date, Iso8601Format format ) : string
date JulianDate The date to convert.
format Iso8601Format The format to use.
Résultat string
Exemple #1
0
 /// <summary>
 /// Gets an appropriate epoch from a list of dates and writes it to the <see cref="CesiumOutputStream"/>
 /// as the "epoch" property.  If the <paramref name="dates"/> collection is empty, the <paramref name="startIndex"/>
 /// is past the end of the collection, or the <paramref name="length"/> is zero, this method does not write
 /// the "epoch" property and returns <see cref="JulianDate.MinValue"/>.
 /// </summary>
 /// <param name="output">The stream to which to write the epoch.</param>
 /// <param name="dates">The collection of dates from which to determine the epoch.</param>
 /// <param name="startIndex">The first index in the collection to use.</param>
 /// <param name="length">The number of items from the collection to use.</param>
 /// <returns>A suitable epoch determined from the collection.</returns>
 private static JulianDate GetAndWriteEpoch(CesiumOutputStream output, IList <JulianDate> dates, int startIndex, int length)
 {
     if (startIndex < dates.Count)
     {
         JulianDate epoch = dates[startIndex];
         output.WritePropertyName("epoch");
         output.WriteValue(CesiumFormattingHelper.ToIso8601(epoch, output.PrettyFormatting ? Iso8601Format.Extended : Iso8601Format.Compact));
         return(epoch);
     }
     else
     {
         return(JulianDate.MinValue);
     }
 }
Exemple #2
0
 /// <summary>
 /// Writes a <see cref="JulianDate"/> as an ISO 8601 interval string.
 /// </summary>
 /// <param name="output">The stream to which to write the value.</param>
 /// <param name="date">The date to write.</param>
 public static void WriteDate(CesiumOutputStream output, JulianDate date)
 {
     output.WriteValue(CesiumFormattingHelper.ToIso8601(date, output.PrettyFormatting ? Iso8601Format.Extended : Iso8601Format.Compact));
 }