FormatTimeMilliseconds

From ESOUI Wiki

Jump to: navigation, search

Constant format is: TIME_FORMAT_${COLUMN}_${VALUE}, for example:

   TIME_FORMAT_STYLE_COOLDOWN_TIME
   TIME_FORMAT_PRECISION_SECONDS

Other combinations of arguments produced no, or useless, output given the set of test inputs. They are omitted for the sake of sanity, and brevity.

Where the output is identical, multiple rows have been collapsed with commas between values, to save space.

The TIME_FORMAT_DIRECTION_* argument makes no difference to output in any of my tests of this function. It may or may not do things in languages other than English, but I'm unable to discover what.

Styles that produce no string output in this test

Style Precision Problem
COOLDOWN_TIME any values empty string
RELATIVE_TIMESTAMP MILLISECONDS empty string
RELATIVE_TIMESTAMP MILLISECONDS_NO_HOURS_OR_DAYS empty string
RELATIVE_TIMESTAMP TWELVE_HOUR empty string
RELATIVE_TIMESTAMP TWENTY_FOUR_HOUR empty string

Style Precision 123ms 1,234ms 12,345ms 123,456ms 1,234,567ms 12,345,678ms 123,456,789ms
CAST_TIME MILLISECONDS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CAST_TIME MILLISECONDS_NO_HOURS_OR_DAYS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CAST_TIME SECONDS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CAST_TIME TENTHS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CAST_TIME TENTHS_RELEVANT 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CAST_TIME TWELVE_HOUR 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CAST_TIME TWENTY_FOUR_HOUR 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CHANNEL_TIME MILLISECONDS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CHANNEL_TIME MILLISECONDS_NO_HOURS_OR_DAYS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CHANNEL_TIME SECONDS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CHANNEL_TIME TENTHS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CHANNEL_TIME TENTHS_RELEVANT 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CHANNEL_TIME TWELVE_HOUR 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CHANNEL_TIME TWENTY_FOUR_HOUR 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
CLOCK_TIME MILLISECONDS 12:00 A.M. 12:00 A.M. 12:00 A.M. 12:02 A.M. 12:20 A.M. 3:25 A.M. 10:17 P.M.
CLOCK_TIME MILLISECONDS_NO_HOURS_OR_DAYS 12:00 A.M. 12:00 A.M. 12:00 A.M. 12:02 A.M. 12:20 A.M. 3:25 A.M. 10:17 P.M.
CLOCK_TIME SECONDS 12:00 A.M. 12:00 A.M. 12:00 A.M. 12:02 A.M. 12:20 A.M. 3:25 A.M. 10:17 P.M.
CLOCK_TIME TENTHS 12:00 A.M. 12:00 A.M. 12:00 A.M. 12:02 A.M. 12:20 A.M. 3:25 A.M. 10:17 P.M.
CLOCK_TIME TENTHS_RELEVANT 12:00 A.M. 12:00 A.M. 12:00 A.M. 12:02 A.M. 12:20 A.M. 3:25 A.M. 10:17 P.M.
CLOCK_TIME TWELVE_HOUR 12:00 A.M. 12:00 A.M. 12:00 A.M. 12:02 A.M. 12:20 A.M. 3:25 A.M. 10:17 P.M.
CLOCK_TIME TWENTY_FOUR_HOUR 00:00 00:00 00:00 00:02 00:20 03:25 10:17
COLONS MILLISECONDS 00s 123ms 01s 234ms 12s 345ms 2m 03s 456ms 20m 34s 567ms 3h 25m 45s 678ms 1d 10h 17m 36s 789ms
COLONS MILLISECONDS_NO_HOURS_OR_DAYS 00s 123ms 01s 234ms 12s 345ms 2m 03s 456ms 20m 34s 567ms 205m 45s 678ms 2057m 36s 789ms
COLONS SECONDS 0:00 0:01 0:12 2:03 20:35 3:25:46 1:10:17:37
COLONS TENTHS 0:00 0:01 0:12 2:03 20:35 3:25:46 1:10:17:37
COLONS TENTHS_RELEVANT 0:00 0:01 0:12 2:03 20:35 3:25:46 1:10:17:37
COLONS TWELVE_HOUR 00s 01s 12s 2m 03s 20m 35s 3h 25m 46s 1d 10h 17m 37s
COLONS TWENTY_FOUR_HOUR 0:00 0:01 0:12 2:03 20:35 3:25:46 1:10:17:37
DESCRIPTIVE MILLISECONDS 0 seconds 1 second 12 seconds 2 minutes and 3 seconds 20 minutes and 35 seconds 3 hours, 25 minutes, and 46 seconds 1 day, 10 hours, 17 minutes, and 37 seconds
DESCRIPTIVE MILLISECONDS_NO_HOURS_OR_DAYS 0 seconds 1 second 12 seconds 2 minutes and 3 seconds 20 minutes and 35 seconds 3 hours, 25 minutes, and 46 seconds 1 day, 10 hours, 17 minutes, and 37 seconds
DESCRIPTIVE SECONDS 0 seconds 1 second 12 seconds 2 minutes and 3 seconds 20 minutes and 35 seconds 3 hours, 25 minutes, and 46 seconds 1 day, 10 hours, 17 minutes, and 37 seconds
DESCRIPTIVE TENTHS 0 seconds 1 second 12 seconds 2 minutes and 3 seconds 20 minutes and 35 seconds 3 hours, 25 minutes, and 46 seconds 1 day, 10 hours, 17 minutes, and 37 seconds
DESCRIPTIVE TENTHS_RELEVANT 0 seconds 1 second 12 seconds 2 minutes and 3 seconds 20 minutes and 35 seconds 3 hours, 25 minutes, and 46 seconds 1 day, 10 hours, 17 minutes, and 37 seconds
DESCRIPTIVE TWELVE_HOUR 0 seconds 1 second 12 seconds 2 minutes and 3 seconds 20 minutes and 35 seconds 3 hours, 25 minutes, and 46 seconds 1 day, 10 hours, 17 minutes, and 37 seconds
DESCRIPTIVE TWENTY_FOUR_HOUR 0 seconds 1 second 12 seconds 2 minutes and 3 seconds 20 minutes and 35 seconds 3 hours, 25 minutes, and 46 seconds 1 day, 10 hours, 17 minutes, and 37 seconds
DESCRIPTIVE_MINIMAL MILLISECONDS 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL MILLISECONDS_NO_HOURS_OR_DAYS 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL SECONDS 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL TENTHS 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL TENTHS_RELEVANT 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL TWELVE_HOUR 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL TWENTY_FOUR_HOUR 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL_HIDE_ZEROES MILLISECONDS 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL_HIDE_ZEROES MILLISECONDS_NO_HOURS_OR_DAYS 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL_HIDE_ZEROES SECONDS 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL_HIDE_ZEROES TENTHS 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL_HIDE_ZEROES TENTHS_RELEVANT 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL_HIDE_ZEROES TWELVE_HOUR 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL_HIDE_ZEROES TWENTY_FOUR_HOUR 0s 1s 12s 2m 3s 20m 35s 3h 25m 46s 1d 10h 17m 37s
DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS MILLISECONDS 0.1s 1.2s 12.3s 2m 3.5s 20m 34.6s 3h 25m 45.7s 1d 10h 17m 36.8s
DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS MILLISECONDS_NO_HOURS_OR_DAYS 0.1s 1.2s 12.3s 2m 3.5s 20m 34.6s 3h 25m 45.7s 1d 10h 17m 36.8s
DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS SECONDS 0.1s 1.2s 12.3s 2m 3.5s 20m 34.6s 3h 25m 45.7s 1d 10h 17m 36.8s
DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS TENTHS 0.1s 1.2s 12.3s 2m 3.5s 20m 34.6s 3h 25m 45.7s 1d 10h 17m 36.8s
DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS TENTHS_RELEVANT 0.1s 1.2s 12.3s 2m 3.5s 20m 34.6s 3h 25m 45.7s 1d 10h 17m 36.8s
DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS TWELVE_HOUR 0.1s 1.2s 12.3s 2m 3.5s 20m 34.6s 3h 25m 45.7s 1d 10h 17m 36.8s
DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS TWENTY_FOUR_HOUR 0.1s 1.2s 12.3s 2m 3.5s 20m 34.6s 3h 25m 45.7s 1d 10h 17m 36.8s
DESCRIPTIVE_SHORT MILLISECONDS 0 sec 1 sec 12 sec 2 min. and 3 sec. 20 min. and 35 sec. 3 hrs, 25 min, and 46 sec 1 day, 10 hrs, 17 min, and 37 sec
DESCRIPTIVE_SHORT MILLISECONDS_NO_HOURS_OR_DAYS 0 sec 1 sec 12 sec 2 min. and 3 sec. 20 min. and 35 sec. 3 hrs, 25 min, and 46 sec 1 day, 10 hrs, 17 min, and 37 sec
DESCRIPTIVE_SHORT SECONDS 0 sec 1 sec 12 sec 2 min. and 3 sec. 20 min. and 35 sec. 3 hrs, 25 min, and 46 sec 1 day, 10 hrs, 17 min, and 37 sec
DESCRIPTIVE_SHORT TENTHS 0 sec 1 sec 12 sec 2 min. and 3 sec. 20 min. and 35 sec. 3 hrs, 25 min, and 46 sec 1 day, 10 hrs, 17 min, and 37 sec
DESCRIPTIVE_SHORT TENTHS_RELEVANT 0 sec 1 sec 12 sec 2 min. and 3 sec. 20 min. and 35 sec. 3 hrs, 25 min, and 46 sec 1 day, 10 hrs, 17 min, and 37 sec
DESCRIPTIVE_SHORT TWELVE_HOUR 0 sec 1 sec 12 sec 2 min. and 3 sec. 20 min. and 35 sec. 3 hrs, 25 min, and 46 sec 1 day, 10 hrs, 17 min, and 37 sec
DESCRIPTIVE_SHORT TWENTY_FOUR_HOUR 0 sec 1 sec 12 sec 2 min. and 3 sec. 20 min. and 35 sec. 3 hrs, 25 min, and 46 sec 1 day, 10 hrs, 17 min, and 37 sec
DESCRIPTIVE_SHORT_SHOW_ZERO_SECS MILLISECONDS 0 sec 1 sec 12 sec 2 min. 3 sec. 20 min. 35 sec. 3 hrs 25 min 46 sec 1 day 10 hrs 17 min 37 sec
DESCRIPTIVE_SHORT_SHOW_ZERO_SECS MILLISECONDS_NO_HOURS_OR_DAYS 0 sec 1 sec 12 sec 2 min. 3 sec. 20 min. 35 sec. 3 hrs 25 min 46 sec 1 day 10 hrs 17 min 37 sec
DESCRIPTIVE_SHORT_SHOW_ZERO_SECS SECONDS 0 sec 1 sec 12 sec 2 min. 3 sec. 20 min. 35 sec. 3 hrs 25 min 46 sec 1 day 10 hrs 17 min 37 sec
DESCRIPTIVE_SHORT_SHOW_ZERO_SECS TENTHS 0 sec 1 sec 12 sec 2 min. 3 sec. 20 min. 35 sec. 3 hrs 25 min 46 sec 1 day 10 hrs 17 min 37 sec
DESCRIPTIVE_SHORT_SHOW_ZERO_SECS TENTHS_RELEVANT 0 sec 1 sec 12 sec 2 min. 3 sec. 20 min. 35 sec. 3 hrs 25 min 46 sec 1 day 10 hrs 17 min 37 sec
DESCRIPTIVE_SHORT_SHOW_ZERO_SECS TWELVE_HOUR 0 sec 1 sec 12 sec 2 min. 3 sec. 20 min. 35 sec. 3 hrs 25 min 46 sec 1 day 10 hrs 17 min 37 sec
DESCRIPTIVE_SHORT_SHOW_ZERO_SECS TWENTY_FOUR_HOUR 0 sec 1 sec 12 sec 2 min. 3 sec. 20 min. 35 sec. 3 hrs 25 min 46 sec 1 day 10 hrs 17 min 37 sec
DURATION MILLISECONDS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
DURATION MILLISECONDS_NO_HOURS_OR_DAYS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
DURATION SECONDS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
DURATION TENTHS 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
DURATION TENTHS_RELEVANT 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
DURATION TWELVE_HOUR 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
DURATION TWENTY_FOUR_HOUR 0.1 seconds 1.2 seconds 12.3 seconds 123.5 seconds 1234.6 seconds 12345.7 seconds 123456.8 seconds
RELATIVE_TIMESTAMP SECONDS [09:25:30] [09:25:31] [09:25:42] [09:27:33] [09:46:04] [12:51:15] [19:43:06]
RELATIVE_TIMESTAMP TENTHS [09:25:30.1] [09:25:31.2] [09:25:42.3] [09:27:33.5] [09:46:4.6] [12:51:15.7] [19:43:6.8]
RELATIVE_TIMESTAMP TENTHS_RELEVANT [09:25:30.1] [09:25:31.2] [09:25:42.3] [09:27:33.5] [09:46:4.6] [12:51:15.7] [19:43:6.8]
SHOW_LARGEST_TWO_UNITS MILLISECONDS 0s 1s 12s 2m 3s 20m 35s 3h 26m 1d 10h
SHOW_LARGEST_TWO_UNITS MILLISECONDS_NO_HOURS_OR_DAYS 0s 1s 12s 2m 3s 20m 35s 3h 26m 1d 10h
SHOW_LARGEST_TWO_UNITS SECONDS 0s 1s 12s 2m 3s 20m 35s 3h 26m 1d 10h
SHOW_LARGEST_TWO_UNITS TENTHS 0s 1s 12s 2m 3s 20m 35s 3h 26m 1d 10h
SHOW_LARGEST_TWO_UNITS TENTHS_RELEVANT 0s 1s 12s 2m 3s 20m 35s 3h 26m 1d 10h
SHOW_LARGEST_TWO_UNITS TWELVE_HOUR 0s 1s 12s 2m 3s 20m 35s 3h 26m 1d 10h
SHOW_LARGEST_TWO_UNITS TWENTY_FOUR_HOUR 0s 1s 12s 2m 3s 20m 35s 3h 26m 1d 10h
SHOW_LARGEST_UNIT MILLISECONDS 0.1s 1.2s 12.3s 2m 21m 3h 1d
SHOW_LARGEST_UNIT MILLISECONDS_NO_HOURS_OR_DAYS 0.1s 1.2s 12.3s 2m 21m 3h 1d
SHOW_LARGEST_UNIT SECONDS 0s 1s 12s 2m 21m 3h 1d
SHOW_LARGEST_UNIT TENTHS 0.1s 1.2s 12.3s 2.1m 20.6m 3.4h 1.4d
SHOW_LARGEST_UNIT TENTHS_RELEVANT 0.1s 1.2s 12.3s 2.1m 20.6m 3.4h 1.4d
SHOW_LARGEST_UNIT TWELVE_HOUR 0.1s 1.2s 12.3s 2m 21m 3h 1d
SHOW_LARGEST_UNIT TWENTY_FOUR_HOUR 0.1s 1.2s 12.3s 2m 21m 3h 1d
SHOW_LARGEST_UNIT_DESCRIPTIVE MILLISECONDS 0.1 seconds 1.2 seconds 12.3 seconds 2 minutes 21 minutes 3 hours 1 day
SHOW_LARGEST_UNIT_DESCRIPTIVE MILLISECONDS_NO_HOURS_OR_DAYS 0.1 seconds 1.2 seconds 12.3 seconds 2 minutes 21 minutes 3 hours 1 day
SHOW_LARGEST_UNIT_DESCRIPTIVE SECONDS 0 seconds 1 second 12 seconds 2 minutes 21 minutes 3 hours 1 day
SHOW_LARGEST_UNIT_DESCRIPTIVE TENTHS 0.1 seconds 1.2 seconds 12.3 seconds 2.1 minutes 20.6 minutes 3.4 hours 1.4 days
SHOW_LARGEST_UNIT_DESCRIPTIVE TENTHS_RELEVANT 0.1 seconds 1.2 seconds 12.3 seconds 2.1 minutes 20.6 minutes 3.4 hours 1.4 days
SHOW_LARGEST_UNIT_DESCRIPTIVE TWELVE_HOUR 0.1 seconds 1.2 seconds 12.3 seconds 2 minutes 21 minutes 3 hours 1 day
SHOW_LARGEST_UNIT_DESCRIPTIVE TWENTY_FOUR_HOUR 0.1 seconds 1.2 seconds 12.3 seconds 2 minutes 21 minutes 3 hours 1 day
SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR MILLISECONDS cffffff0.1|r seconds cffffff1.2|r seconds cffffff12.3|r seconds cffffff2|r minutes cffffff21|r minutes cffffff3|r hours cffffff1|r day
SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR MILLISECONDS_NO_HOURS_OR_DAYS cffffff0.1|r seconds cffffff1.2|r seconds cffffff12.3|r seconds cffffff2|r minutes cffffff21|r minutes cffffff3|r hours cffffff1|r day
SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR SECONDS 0s 1s 12s cffffff2|r minutes cffffff21|r minutes cffffff3|r hours cffffff1|r day
SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR TENTHS cffffff0.1|r seconds cffffff1.2|r seconds cffffff12.3|r seconds cffffff2.1|r minutes cffffff20.6|r minutes cffffff3.4|r hours cffffff1.4|r days
SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR TENTHS_RELEVANT cffffff0.1|r seconds cffffff1.2|r seconds cffffff12.3|r seconds cffffff2.1|r minutes cffffff20.6|r minutes cffffff3.4|r hours cffffff1.4|r days
SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR TWELVE_HOUR cffffff0.1|r seconds cffffff1.2|r seconds cffffff12.3|r seconds cffffff2|r minutes cffffff21|r minutes cffffff3|r hours cffffff1|r day
SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR TWENTY_FOUR_HOUR cffffff0.1|r seconds cffffff1.2|r seconds cffffff12.3|r seconds cffffff2|r minutes cffffff21|r minutes cffffff3|r hours cffffff1|r day
SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT MILLISECONDS 0.1 sec 1.2 sec 12.3 sec 2 min 21 min 3 hour 1 day
SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT MILLISECONDS_NO_HOURS_OR_DAYS 0.1 sec 1.2 sec 12.3 sec 2 min 21 min 3 hour 1 day
SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT SECONDS 0 sec 1 sec 12 sec 2 min 21 min 3 hour 1 day
SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT TENTHS 0.1 sec 1.2 sec 12.3 sec 2.1 min 20.6 min 3.4 hour 1.4 day
SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT TENTHS_RELEVANT 0.1 sec 1.2 sec 12.3 sec 2.1 min 20.6 min 3.4 hour 1.4 day
SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT TWELVE_HOUR 0.1 sec 1.2 sec 12.3 sec 2 min 21 min 3 hour 1 day
SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT TWENTY_FOUR_HOUR 0.1 sec 1.2 sec 12.3 sec 2 min 21 min 3 hour 1 day


= lua code used to generate this output

Note: I hand-processed the results to get the output. I probably should have just written some lua code and stored raw values. Learn from my mistakes.

TT = {}
function M:TimeTest()
 
  TT.precisionValue = {
    TIME_FORMAT_PRECISION_MILLISECONDS,
    TIME_FORMAT_PRECISION_MILLISECONDS_NO_HOURS_OR_DAYS,
    TIME_FORMAT_PRECISION_SECONDS,
    TIME_FORMAT_PRECISION_TENTHS,
    TIME_FORMAT_PRECISION_TENTHS_RELEVANT,
    TIME_FORMAT_PRECISION_TWELVE_HOUR,
    TIME_FORMAT_PRECISION_TWENTY_FOUR_HOUR,
  }
 
  TT.precisionName = {}
  TT.precisionName[TIME_FORMAT_PRECISION_MILLISECONDS]="MILLISECONDS"
  TT.precisionName[TIME_FORMAT_PRECISION_MILLISECONDS_NO_HOURS_OR_DAYS]="MILLISECONDS_NO_HOURS_OR_DAYS"
  TT.precisionName[TIME_FORMAT_PRECISION_SECONDS]="SECONDS"
  TT.precisionName[TIME_FORMAT_PRECISION_TENTHS]="TENTHS"
  TT.precisionName[TIME_FORMAT_PRECISION_TENTHS_RELEVANT]="TENTHS_RELEVANT"
  TT.precisionName[TIME_FORMAT_PRECISION_TWELVE_HOUR]="TWELVE_HOUR"
  TT.precisionName[TIME_FORMAT_PRECISION_TWENTY_FOUR_HOUR]="TWENTY_FOUR_HOUR"
 
  TT.styleValue = {
    TIME_FORMAT_STYLE_CAST_TIME,
    TIME_FORMAT_STYLE_CHANNEL_TIME,
    TIME_FORMAT_STYLE_CLOCK_TIME,
    TIME_FORMAT_STYLE_COLONS,
    TIME_FORMAT_STYLE_COOLDOWN_TIME,
    TIME_FORMAT_STYLE_DESCRIPTIVE,
    TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL,
    TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL_HIDE_ZEROES,
    TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS,
    TIME_FORMAT_STYLE_DESCRIPTIVE_SHORT,
    TIME_FORMAT_STYLE_DESCRIPTIVE_SHORT_SHOW_ZERO_SECS,
    TIME_FORMAT_STYLE_DURATION,
    TIME_FORMAT_STYLE_RELATIVE_TIMESTAMP,
    TIME_FORMAT_STYLE_SHOW_LARGEST_TWO_UNITS,
    TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT,
    TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT_DESCRIPTIVE,
    TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR,
    TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT,
  }
 
  TT.styleName = {}
  TT.styleName[TIME_FORMAT_STYLE_CAST_TIME]="CAST_TIME"
  TT.styleName[TIME_FORMAT_STYLE_CHANNEL_TIME]="CHANNEL_TIME"
  TT.styleName[TIME_FORMAT_STYLE_CLOCK_TIME]="CLOCK_TIME"
  TT.styleName[TIME_FORMAT_STYLE_COLONS]="COLONS"
  TT.styleName[TIME_FORMAT_STYLE_COOLDOWN_TIME]="COOLDOWN_TIME"
  TT.styleName[TIME_FORMAT_STYLE_DESCRIPTIVE]="DESCRIPTIVE"
  TT.styleName[TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL]="DESCRIPTIVE_MINIMAL"
  TT.styleName[TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL_HIDE_ZEROES]="DESCRIPTIVE_MINIMAL_HIDE_ZEROES"
  TT.styleName[TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS]="DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS"
  TT.styleName[TIME_FORMAT_STYLE_DESCRIPTIVE_SHORT]="DESCRIPTIVE_SHORT"
  TT.styleName[TIME_FORMAT_STYLE_DESCRIPTIVE_SHORT_SHOW_ZERO_SECS]="DESCRIPTIVE_SHORT_SHOW_ZERO_SECS"
  TT.styleName[TIME_FORMAT_STYLE_DURATION]="DURATION"
  TT.styleName[TIME_FORMAT_STYLE_RELATIVE_TIMESTAMP]="RELATIVE_TIMESTAMP"
  TT.styleName[TIME_FORMAT_STYLE_SHOW_LARGEST_TWO_UNITS]="SHOW_LARGEST_TWO_UNITS"
  TT.styleName[TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT]="SHOW_LARGEST_UNIT"
  TT.styleName[TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT_DESCRIPTIVE]="SHOW_LARGEST_UNIT_DESCRIPTIVE"
  TT.styleName[TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR]="SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR"
  TT.styleName[TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT]="SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT"
 
  table.sort(TT.precisionValue, function(a, b) return TT.precisionName[a] < TT.precisionName[b] end)
  table.sort(TT.styleValue, function(a, b) return TT.styleName[a] < TT.styleName[b] end)
 
  local samples = {123, 1234, 12345, 123456, 1234567, 12345678, 123456789}
  local output = {}
  local badCombo = {}
 
  local header = "\n\n\n{| class=\"wikitable\"\n! Style || Precision"
  for _, time in ipairs(samples) do
    local text = FormatIntegerWithDigitGrouping(time, ",", 3)
    header = header.." || "..text.."ms"
  end
  insert(output, header)
 
  for _, style in ipairs(TT.styleValue) do
    for _, precision in ipairs(TT.precisionValue) do
      local styleName = TT.styleName[style]
      local precisionName = TT.precisionName[precision]
 
      local text = zo_strformat("| <code><<1>></code> || <code><<2>></code>", styleName, precisionName)
 
      for _, time in ipairs(samples) do
        local result = FormatTimeMilliseconds(time, style, precision, 0)
        if styleName == "COOLDOWN_TIME" then
          d(styleName..", "..precisionName.." result: "..result)
        end
        if result == nil or result == '' then
          insert(badCombo, {styleName, precisionName, "empty string"})
          result = '&mdash;'
        else
          result = string.gsub(result, '%s', '&nbsp;')
        end
        text = text.." || "..result
      end
 
      insert(output, text)
      insert(output, "|-")
    end
  end
  insert(output, "|}\n")
 
  if #badCombo > 0 then
    insert(output, 1, "|}")
 
    for i = #badCombo, 1, -1 do
      insert(output, 1, string.format("| <code>%s</code> || <code>%s</code> || '''%s'''", unpack(badCombo[i])))
      insert(output, 1, "|-")
    end
 
    insert(output, 1, "! Style || Precision || Problem")
    insert(output, 1, '{| class="wikitable"')
  end
 
  self.seen.haxxx = output
  msg("timetest 18")
end
Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox