Chrono Mock
LanguageEnglish
Documentation JSON output

The window

Scenarios and calendars

JSON output

With --json, every chrono command writes its answer for a program to read rather than for a person: a script, a test or a step of a pipeline. This page names every field.

How it works

  • Standard output carries the JSON and nothing else. Messages for people go to standard error, and so does the console output of an application that chrono run starts.
  • The exit code is the same as without --json, so a script can act on it before it reads a single field. Exit codes lists them.
  • calc, presets, calendars and run --dry-run write one JSON document on one line. Its first field, schema, names which one it is. chrono run writes a line for each thing that happens while the session runs.
  • Fields and kinds of line are added from version to version. A program that reads this output should pass over what it does not know. Every change to a field is named in the changelog.
  • A field marked In the next release is not in the latest release yet and comes with the next one.

Dates, times and zones

A date and time is written as a clock on the wall shows it, without its zone, such as 2038-01-19T03:14:07. The zone is in the field beside it, zone_bias_min: the minutes to add to that time to get UTC, the way Windows counts them. UTC+02:00 is -120, UTC-05:00 is 300 and UTC is 0. The sign is the opposite of the one in +02:00, so check it before you convert.

chrono calc --json

Schema chronomock.calc/1. A date built from steps, or from a preset, comes as moment. The program writes it on one line, shown here on several:

chrono calc --base 2026-01-31T00:00:00 --shift +1mo --zone +02:00 --json
{
  "schema": "chronomock.calc/1",
  "moment": {
    "iso": "2026-02-28T00:00:00",
    "zone_bias_min": -120,
    "base": "2026-01-31T00:00:00",
    "steps": ["2026-02-28T00:00:00"],
    "formats": {
      "iso_date": "2026-02-28",
      "iso_datetime": "2026-02-28T00:00:00+02:00",
      "us": "02/28/2026",
      "pl": "28.02.2026",
      "epoch_seconds": 1772229600,
      "epoch_millis": 1772229600000,
      "filetime": 134167032000000000,
      "rfc1123": "Fri, 27 Feb 2026 22:00:00 GMT"
    },
    "metadata": {
      "weekday": "Saturday",
      "iso_week_year": 2026,
      "iso_week": 9,
      "us_week": 9,
      "day_of_year": 59,
      "quarter": 1,
      "is_leap_year": false,
      "days_from_today": -269,
      "business_day": null,
      "holiday": null,
      "calendar": null,
      "calendar_valid_from": null,
      "calendar_law_as_of": null
    },
    "significance": ["last_day_of_february_common_year"],
    "clamped_steps": [{ "step": 1, "requested_day": 31, "clamped_to": 28 }]
  }
}
FieldWhat it holds
schemachronomock.calc/1.
moment.isoThe result, a date and time in the zone of the next field.
moment.zone_bias_minThe zone of the result: the session's, unless a --to-zone step moved it.
moment.baseWhere the steps started: --base, or today at midnight.
moment.stepsThe date after each step, in order. The last one is the result.
moment.formats.iso_date2026-02-28.
moment.formats.iso_datetimeWith the offset from UTC: 2026-02-28T00:00:00+02:00.
moment.formats.usMonth first: 02/28/2026.
moment.formats.plDay first: 28.02.2026.
moment.formats.epoch_secondsSeconds since 1970-01-01 00:00 UTC. Null for a moment outside the years Windows can hold, 1601 to 30828, and so are the next three fields.
moment.formats.epoch_millisThe same in milliseconds.
moment.formats.filetimeA Windows FILETIME: the number of 100-nanosecond steps since 1601-01-01 00:00 UTC.
moment.formats.rfc1123The form HTTP headers use, in GMT: Fri, 27 Feb 2026 22:00:00 GMT.
moment.metadata.weekdayMonday to Sunday, in English.
moment.metadata.iso_week_yearThe year the ISO week belongs to. Around New Year it can differ from the year of the date.
moment.metadata.iso_weekThe ISO week, 1 to 53, with weeks starting on Monday.
moment.metadata.us_weekThe week the way the US counts it, with weeks starting on Sunday and week 1 holding 1 January.
moment.metadata.day_of_year1 to 366.
moment.metadata.quarter1 to 4.
moment.metadata.is_leap_yeartrue or false.
moment.metadata.days_from_todayWhole days from today, counted in the session's zone. Negative for a date in the past.
moment.metadata.business_dayWith --calendar, whether the date is a business day there. Null without a calendar, and for a year before the calendar's first one.
moment.metadata.holidayThe English name of the holiday on that date, or null.
moment.metadata.calendarThe calendar the two fields above come from, or null.
moment.metadata.calendar_valid_fromThe first year that calendar covers.
moment.metadata.calendar_law_as_ofThe day its holidays were last checked against the law, YYYY-MM-DD.
moment.significanceWhat the date lands on, in the words below. Empty when it lands on nothing in particular.
moment.custom_formatWith --format, the date written with your mask.
moment.custom_format_unknownThe letters of the mask that are not a part of any format, and so were written as they are. Only when there are some.
moment.clamped_stepsThe steps that asked for a day the month does not have, such as 31 February. Each gives step (1 is the first), requested_day and clamped_to, the last day of that month. Only when there are some.
moment.presetWith --preset: its id, its name and explains, the sentence on what it tests.

A pasted date, --analyze, comes as analysis instead, with one reading or two:

FieldWhat it holds
analysis.inputThe text, as it came.
analysis.ambiguoustrue when it reads two ways, as 04/08/2008 does.
analysis.zone_bias_minThe zone the readings are in. It matters for a number such as Unix time, which is an instant: its date and time are given in this zone. A date written out does not move with it.
analysis.readings[].readingWhich reading: iso, us_month_day, pl_day_month, epoch_seconds or epoch_millis.
analysis.readings[].isoThe reading as a date and time.
analysis.readings[].instanttrue for a number of seconds or milliseconds since 1970.
analysis.readings[].timeThe time of day to show with it, HH:MM:SS, or null when there is none to show, as for a date written without a time.
analysis.readings[].significanceWhat it lands on, in the same words as moment.significance.
analysis.readings[].metadataThe same fields as moment.metadata.

The words of significance:

  • start_of_month, start_of_quarter, start_of_year: the first day of the period, at any time of that day. Only the largest one, so 1 January is start_of_year alone.
  • end_of_month, end_of_quarter, end_of_year: the last day, the same way.
  • leap_day: 29 February. last_day_of_february_common_year: 28 February in a year without a 29th.
  • unix_epoch: exactly 1970-01-01 00:00:00 UTC. year_2038_boundary: 2038-01-19 03:14:07 UTC or later, where a count of seconds in 32 bits runs out.
  • With --calendar: weekend, public_holiday (a holiday on its own date) and observed_holiday (a weekday off because a holiday fell on the weekend).
  • before_calendar: a year before the calendar's first one, so the date was not judged.
  • calendar_outdated: the calendar was last checked against the law more than a year ago, and the answer depends on a day after that check, so a change in the law since then may be missing.

When calc cannot do what you asked, standard output stays empty and the reason is on standard error, with one of the codes Exit codes lists.

chrono presets --json

Schema chronomock.presets/1. Every preset the program reads, the way --preset reads it, and every file it refuses, with the reason. A refused file is a part of the answer, so the command still ends with 0. It ends with 1 only for a wrong option or a folder it cannot read. What each preset is for is on Scenarios.

FieldWhat it holds
schemachronomock.presets/1.
dirThe folder it read: --dir, or else the presets folder next to chrono.exe, or else the one in the current folder.
presets[].fileThe name of the file.
presets[].idWhat --preset takes.
presets[].applies_tocalculator for chrono calc only, substitution for chrono run only, or both.
presets[].marketus or pl for a preset that follows one country's rules, or null.
presets[].calendarThe calendar it counts business days in, which comes with its market, or null.
presets[].nameIts name, as en and pl.
presets[].explainsThe sentence on what it tests, as en and pl.
presets[].time_modeHow a session on it runs: multiplier, the speed (1 is real speed), and scale_duration_clock, whether timers follow that speed, as with --scale-duration.
presets[].parameters[].idWhat --param id=value names.
presets[].parameters[].typedate, duration (such as 30d) or variant, one of the words in choices.
presets[].parameters[].labelWhat to call it, as en and pl.
presets[].parameters[].defaultThe value when --param leaves it out: a word, or {"amount": 30, "unit": "d"} for a duration. Null when it has to be given.
presets[].parameters[].default_hinttarget_file_creation when chrono run takes the date of the application's own file for a value not given, or null.
presets[].parameters[].choicesOnly for a variant: each word as label and how many days it moves the date.
presets[].moment.baseWhere the date starts, by kind: today, now, absolute or absolute_utc with at, or parameter with the parameter it reads.
presets[].moment.stepsWhat happens to it next, in order, by kind: shift (a sign, then an amount and a unit or the parameter they come from), snap and nearest (a target), set_time (a time) and zone (an offset). The words are the ones the options of chrono calc take.
refused[].fileThe name of a file the program refuses.
refused[].idThe id its name gives it, or null when the name cannot be one.
refused[].reasonWhy: the sentence --preset gives for it.
refused[].exit_codeThe code --preset ends with for it.

chrono calendars --json

Schema chronomock.calendars/1. The calendars --calendar can count in, and every file it refuses, ending with 0 and 1 the same way as presets. The holidays themselves are in the files, described on Holiday calendars.

FieldWhat it holds
schemachronomock.calendars/1.
dirThe folder it read: --dir, or else the calendars folder next to chrono.exe, or else the one in the current folder.
calendars[].fileThe name of the file.
calendars[].idWhat --calendar takes.
calendars[].countryThe two-letter code of the country, such as PL.
calendars[].nameIts name, as en and in the country's own language as local.
refused[].fileThe name of a file the program refuses.
refused[].idThe id its name gives it, or null when the name cannot be one.
refused[].reasonWhy the program refuses it.

chrono run --dry-run --json

Schema chronomock.plan/1. What a session would be, worked out without starting anything: no application starts and no file is written. It ends with 0 when the session could start, and with the code the session would end with when it could not.

chrono run C:\apps\test.exe --at 2038-01-19T03:14:07 --zone +00:00 --dry-run --json
{
  "schema": "chronomock.plan/1",
  "started": false,
  "target": { "path": "C:\\apps\\test.exe", "resolved": "C:\\apps\\test.exe", "state": "found",
              "program": null, "args": [], "cwd": null },
  "mechanism": "native",
  "core_bitness": "x64",
  "time": { "moment": "2038-01-19T03:14:07", "zone_bias_min": 0, "zone_from_flag": true,
            "mode": "flow", "multiplier": null, "scale_duration": false, "scale_qpc": false },
  "origin": { "kind": "at", "at": "2038-01-19T03:14:07", "preset": null, "parameters": [] },
  "session": { "ticks": 0, "timeout_secs": null, "set_after": null, "jump_after": null,
               "commands": false, "force": false, "embedded": true, "elevated_embedded": false,
               "elevated_embedded_value": null, "keep_background_timers": false,
               "gecko_sandbox": true, "report": null },
  "warnings": []
}
FieldWhat it holds
schemachronomock.plan/1.
startedAlways false, so the answer cannot be taken for a session.
target.pathThe application, as you typed it.
target.resolvedThe full path of the file the session would start, or null when there is none.
target.statefound; not_a_program, a file Windows would not start; missing; or unchecked, a bare name that the Chromium mode looks up on the PATH itself.
target.programIn the next releaseFor the starter an installer puts beside Update.exe, the program the session would start in its place. Null otherwise.
target.argsThe arguments, from --args.
target.cwdThe folder from --cwd, or null.
mechanismnative, or chromium-cdp for a Chromium or Electron application.
core_bitnessx64 or x86: the bitness of this chrono.exe, not of the application, which is only known once it runs.
time.momentThe date and time the session would start at.
time.zone_bias_minThe session's zone.
time.zone_from_flagtrue when --zone named it, false when it is this computer's.
time.modeflow, frozen or multiplier.
time.multiplierThe speed for multiplier, such as 60. Null otherwise.
time.scale_durationWhether --scale-duration was given.
time.scale_qpcWhether --scale-qpc was given.
origin.kindWhere the date comes from: at, preset, or now when neither was given.
origin.atThe --at value as typed, or null.
origin.presetThe preset, or null.
origin.parameters[].idA parameter of the preset.
origin.parameters[].valueThe value it got.
origin.parameters[].sourceWhere the value came from, in words, such as the target's file date.
session.ticksThe --ticks limit, 0 for none.
session.timeout_secsThe --timeout limit, or null.
session.set_after--set-after as [tick, speed], or null.
session.jump_after--jump-after as [tick, moment], or null.
session.commandsIn the next releaseWhether --commands was given: the session would take its commands from standard input.
session.forceWhether --force was given.
session.embeddedWhether the session would try to reach the web pages inside the application, which --no-embedded turns off.
session.elevated_embeddedWhether --elevated-embedded was given.
session.elevated_embedded_valueThe name the session would write its registry value under for it, or null.
session.keep_background_timersWhether --keep-background-timers was given.
session.gecko_sandboxIn the next releaseWhether the Gecko sandbox would stay on: false with --no-gecko-sandbox.
session.reportThe --report file, or null.
warningsWhat the session would warn about before it starts, as the keys the report writes in brackets.

chrono run --json

Instead of the report, a session writes one JSON line for each thing that happens, as it happens. Every line has type, which says what the line is, and v, the version of the lines. A short session looks like this, with the list of clocks cut short:

chrono run C:\apps\test.exe --at 2038-01-19T03:14:07 --zone +00:00 --ticks 2 --json
{"type":"ready","v":1,"protocol":1,"core_version":"0.6.0-rc.1","bitness":"x64","capabilities":[]}
{"type":"coverage","v":1,"pid":71984,"kind":"process","covered":[{"channel":"GetSystemTimeAsFileTime","calls":1},...],"observed":[...],"uncovered":[],"unobserved":[],"installed_late":[],"warning_keys":[]}
{"type":"verdict","v":1,"id":1,"verdict":"works","refuse_start":false,"reason_key":"coverage.time_channels_covered"}
{"type":"state","v":1,"fake":{"wall":"2038-01-19T03:14:08","zone_bias_min":0},"real":{"wall":"2026-11-24T13:51:09","zone_bias_min":0},"multiplier":1,"elapsed_fake_ms":1563,"elapsed_real_ms":1563}
{"type":"state","v":1,"fake":{"wall":"2038-01-19T03:14:09","zone_bias_min":0},"real":{"wall":"2026-11-24T13:51:10","zone_bias_min":0},"multiplier":1,"elapsed_fake_ms":2565,"elapsed_real_ms":2565}
{"type":"coverage","v":1,"pid":71984,"kind":"process","covered":[...],...}
{"type":"session_verdict","v":1,"verdict":"works","reason_key":"session.family_covered","process_count":1,"warning_keys":["session.left_running"],...}
{"type":"ended","v":1,"clean":true,"residue_keys":[],"target_exit_code":null,"elapsed_real_ms":2569,"elapsed_fake_ms":2569,"fake_end_wall":"2038-01-19T03:14:09"}
LineWhenFields
readyFirst: the session is ready to start.protocol, core_version, bitness, capabilities
coverageFor each process the session reaches, or each web page in the Chromium mode, when it is reached and again at the end: the clocks it read and how many times.pid, kind, covered, observed, uncovered, unobserved, installed_late, warning_keys
verdictRight after the start: whether the application reads the session's clock. With refuse_start the session ends the application, unless --force was given.id, verdict, refuse_start, reason_key, left_running, family_search_incomplete
ackA change of speed or a jump from --set-after or --jump-after was made, or a command from standard input under --commands was carried outIn the next release. id is the command's own.id
stateAbout once a second: the session's clock and the real one side by side.fake, real, multiplier, elapsed_fake_ms, elapsed_real_ms
host_sleptThe computer slept during the session. The session's clock stood still while it slept.slept_ms, total_slept_ms
vanishedThe application closed right after the start, most likely handing its work to a copy of it that was already running. The command ends with 12.pid, reason_key, lived_ms
errorSomething failed, named by key. Before the start it means the session never began.id, code, key, origin
session_verdictOnce, at the end: the verdict for the application and every process it started. The exit code says the same.verdict, reason_key, process_count, warning_keys, uncovered_children, uncovered_children_total, context_count, engines, followed, copies_outsideIn the next release, host_slept_ms, browser
endedLast: the session is over.clean, residue_keys, target_exit_code, elapsed_real_ms, elapsed_fake_ms, fake_end_wall

The fields a pipeline usually needs:

  • verdict of session_verdict: works, partial, fails or undetermined, the four verdicts the exit codes 0, 10, 11 and 4 carry.
  • reason_key, warning_keys, residue_keys and key name what happened in a few words that do not change between versions, such as session.left_running. The report puts the key of a warning or an error in brackets after the sentence that explains it.
  • process_count: how many processes the verdict covers, the application and everything it started.
  • target_exit_code of ended: the code the application ended with when it closed itself. Null when the session ended first, which --ticks and --timeout do. It is not the exit code of chrono.
  • fake and real of state: each a wall clock and its zone_bias_min.

A session cut short by --timeout ends without the last two lines, and the command ends with 6.