Class ISOTime

java.lang.Object
com.adobe.xfa.ut.LcTime
com.adobe.xfa.ut.ISOTime

public final class ISOTime extends LcTime
The ISOTime class derives from LcTime to define ISO8601/XFA time patterns.

Valid ISO8601/XFA time strings are in any one of the following time patterns:

  • HH[MM[SS[.FFF][z]]]
  • HH[MM[SS[.FFF][+HH[MM]]]]
  • HH[MM[SS[.FFF][-HH[MM]]]]
  • HH[:MM[:SS[.FFF][z]]]
  • HH[:MM[:SS[.FFF][+HH[:MM]]]]
  • HH[:MM[:SS[.FFF][-HH[:MM]]]]
where [...] denotes optional elements. See LcTime for the meaning of the various metasymbols used above. Here's a snippet of code illustrating the use of ISOTime to reformat an ISO8601/XFA time string

      import com.adobe.xfa.ut.ISOTime;
      import com.adobe.xfa.ut.LcTime;
      ...
      ISOTime t = new ISOTime("11:12:13-05:00", "");
      fString s = "Unknown";
      if (t.isValid())
          s = t.format(LcTime.XFA_TIME_FMT1);
      System.out.println(s);
 
  • Constructor Details

    • ISOTime

      public ISOTime()
      Instantiate an ISOTime object from today's time.
    • ISOTime

      public ISOTime(int millis)
      Instantiate an ISOTime object from the given number of milliseconds from the epoch. The epoch is such that millisecond 1 corresponds to midnight, 00:00:00 GMT.
      Parameters:
      millis - the number of milliseconds from epoch.
    • ISOTime

      public ISOTime(String locale, int centurySplit)
      Instantiate an ISOTime object from today's time given a locale string and a possible century split year.
      Parameters:
      locale - a locale string. When empty, it will default to the current locale.
      centurySplit - a century split year.
    • ISOTime

      public ISOTime(String time, String locale)
      Instantiate an ISOTime object from the given time string.
      Parameters:
      time - an ISO8601/XFA time string.
      locale - a locale string. When empty, it will default to the current locale.