Class Dates

java.lang.Object
dev.gmitch215.bytebox.text.Dates

public final class Dates extends Object
%t and %T for String.format, which a project switches on with classlib { dateFormat = true }.

The arguments are a long, a Long, a Date, a Calendar or a TemporalAccessor, which are the ones a JVM takes. An epoch value, and a Date, are read in UTC, which is the zone a Worker runs in; a Calendar and a temporal carry their own. Every conversion a JVM has is here except two:

  • %tZ, and %tc which contains it, are the zone's short name, which is data the platform does not hand over in the form a JVM prints.
  • An epoch value before 1582-10-15 is read by a JVM in the Julian calendar, which is not implemented here.

Names and the am/pm marker are written in English, so Locale.US, Locale.ENGLISH and no locale at all are accepted and any other locale is refused: a JVM's en_GB writes Sept and its en_CA writes p.m., which is data this class does not have.

Since:
1.0.3
  • Method Details

    • register

      public static void register()
      Makes %t work, which is what the generated entry point calls.