For AI agents: the complete documentation index is available at https://open-spaced-repetition.github.io/ts-fsrs/llms.txt, the full documentation bundle is available at https://open-spaced-repetition.github.io/ts-fsrs/llms-full.txt, and this page is available as Markdown at https://open-spaced-repetition.github.io/ts-fsrs/guide/chrono/temporal-instant.md.

Temporal Instant

Configure temporalInstantChrono with timezone and fractionalDays directly in the scheduler config, for example config: { ...modelConfig, timezone: 'Asia/Tokyo', fractionalDays: false }. Both fields can be omitted to use defaults ('UTC' and false). Direct calls require the complete configuration: temporalInstantChrono.create({ config: { timezone: 'Asia/Tokyo', fractionalDays: false } }). Scheduler creation validates configuration and supplies defaults.

With fractionalDays: false, difference counts calendar days in the configured timezone. With true, it includes fractions of a day in that timezone. add uses fixed 24-hour days for UTC and calendar days for other timezones; across daylight-saving transitions, a local day can be shorter or longer than 24 hours. Fractional additions use the length of the adjacent local day. This preset does not implement a custom daily rollover hour.

Run the preset

Install temporal-polyfill in your application. The example imports its global entry point before creating the Chrono; it installs Temporal in the executing runtime only when native Temporal is unavailable. The second import supplies global TypeScript declarations.

npm
yarn
pnpm
bun
deno
npm install temporal-polyfill
import 'temporal-polyfill/global'
import 'temporal-polyfill/types/global'
import { 
const temporalInstantChrono: Chrono<{
    readonly time: SRSSchema<{
        input: Temporal.Instant;
        output: Temporal.Instant;
    }>;
    readonly config: SRSSchema<{
        input: {
            readonly timezone?: string | undefined;
            readonly fractionalDays?: boolean | undefined;
        };
        output: {
            readonly timezone: string;
            readonly fractionalDays: boolean;
        };
    }>;
    readonly fields: {
        readonly card: SRSSchema<{
            input: {
                dueAt: Temporal.Instant;
                lastReviewAt?: (Temporal.Instant | null) | undefined;
            };
            output: {
                dueAt: Temporal.Instant;
                lastReviewAt: Temporal.Instant | null;
            };
        }>;
        readonly revlog: SRSSchema<{
            input: {
                dueAt: Temporal.Instant;
                lastReviewAt?: (Temporal.Instant | null) | undefined;
                reviewTime: Temporal.Instant;
            };
            output: {
                dueAt: Temporal.Instant;
                lastReviewAt: Temporal.Instant | null;
                reviewTime: Temporal.Instant;
            };
        }>;
    };
}>
temporalInstantChrono
} from 'ts-fsrs'
const
const clock: ChronoCore<Temporal.Instant>
clock
=
const temporalInstantChrono: Chrono<{
    readonly time: SRSSchema<{
        input: Temporal.Instant;
        output: Temporal.Instant;
    }>;
    readonly config: SRSSchema<{
        input: {
            readonly timezone?: string | undefined;
            readonly fractionalDays?: boolean | undefined;
        };
        output: {
            readonly timezone: string;
            readonly fractionalDays: boolean;
        };
    }>;
    readonly fields: {
        readonly card: SRSSchema<{
            input: {
                dueAt: Temporal.Instant;
                lastReviewAt?: (Temporal.Instant | null) | undefined;
            };
            output: {
                dueAt: Temporal.Instant;
                lastReviewAt: Temporal.Instant | null;
            };
        }>;
        readonly revlog: SRSSchema<{
            input: {
                dueAt: Temporal.Instant;
                lastReviewAt?: (Temporal.Instant | null) | undefined;
                reviewTime: Temporal.Instant;
            };
            output: {
                dueAt: Temporal.Instant;
                lastReviewAt: Temporal.Instant | null;
                reviewTime: Temporal.Instant;
            };
        }>;
    };
}>
temporalInstantChrono
.
Chrono<{ readonly time: SRSSchema<{ input: Temporal.Instant; output: Temporal.Instant; }>; readonly config: SRSSchema<{ input: { readonly timezone?: string | undefined; readonly fractionalDays?: boolean | undefined; }; output: { readonly timezone: string; readonly fractionalDays: boolean; }; }>; readonly fields: { readonly card: SRSSchema<{ input: { dueAt: Temporal.Instant; lastReviewAt?: (Temporal.Instant | null) | undefined; }; output: { dueAt: Temporal.Instant; lastReviewAt: Temporal.Instant | null; }; }>; readonly revlog: SRSSchema<{ input: { dueAt: Temporal.Instant; lastReviewAt?: (Temporal.Instant | null) | undefined; reviewTime: Temporal.Instant; }; output: { dueAt: Temporal.Instant; lastReviewAt: Temporal.Instant | null; reviewTime: Temporal.Instant; }; }>; }; }>.create: (ctx: {
    readonly config: {
        readonly timezone: string;
        readonly fractionalDays: boolean;
    };
}) => ChronoCore<Temporal.Instant>
create
({
config: { timezone: 'America/New_York', fractionalDays: false }, }) const
const fractionalClock: ChronoCore<Temporal.Instant>
fractionalClock
=
const temporalInstantChrono: Chrono<{
    readonly time: SRSSchema<{
        input: Temporal.Instant;
        output: Temporal.Instant;
    }>;
    readonly config: SRSSchema<{
        input: {
            readonly timezone?: string | undefined;
            readonly fractionalDays?: boolean | undefined;
        };
        output: {
            readonly timezone: string;
            readonly fractionalDays: boolean;
        };
    }>;
    readonly fields: {
        readonly card: SRSSchema<{
            input: {
                dueAt: Temporal.Instant;
                lastReviewAt?: (Temporal.Instant | null) | undefined;
            };
            output: {
                dueAt: Temporal.Instant;
                lastReviewAt: Temporal.Instant | null;
            };
        }>;
        readonly revlog: SRSSchema<{
            input: {
                dueAt: Temporal.Instant;
                lastReviewAt?: (Temporal.Instant | null) | undefined;
                reviewTime: Temporal.Instant;
            };
            output: {
                dueAt: Temporal.Instant;
                lastReviewAt: Temporal.Instant | null;
                reviewTime: Temporal.Instant;
            };
        }>;
    };
}>
temporalInstantChrono
.
Chrono<{ readonly time: SRSSchema<{ input: Temporal.Instant; output: Temporal.Instant; }>; readonly config: SRSSchema<{ input: { readonly timezone?: string | undefined; readonly fractionalDays?: boolean | undefined; }; output: { readonly timezone: string; readonly fractionalDays: boolean; }; }>; readonly fields: { readonly card: SRSSchema<{ input: { dueAt: Temporal.Instant; lastReviewAt?: (Temporal.Instant | null) | undefined; }; output: { dueAt: Temporal.Instant; lastReviewAt: Temporal.Instant | null; }; }>; readonly revlog: SRSSchema<{ input: { dueAt: Temporal.Instant; lastReviewAt?: (Temporal.Instant | null) | undefined; reviewTime: Temporal.Instant; }; output: { dueAt: Temporal.Instant; lastReviewAt: Temporal.Instant | null; reviewTime: Temporal.Instant; }; }>; }; }>.create: (ctx: {
    readonly config: {
        readonly timezone: string;
        readonly fractionalDays: boolean;
    };
}) => ChronoCore<Temporal.Instant>
create
({
config: { timezone: 'America/New_York', fractionalDays: true }, }) // Noon in New York, the day before daylight saving time starts. const from = Temporal.Instant.from('2026-03-07T17:00:00Z') const next =
const clock: ChronoCore<Temporal.Instant>
clock
.
ChronoCore<Temporal.Instant>.add: (from: Temporal.Instant, days: number) => Temporal.Instant
add
(from, 1)
const halfDay =
const clock: ChronoCore<Temporal.Instant>
clock
.
ChronoCore<Temporal.Instant>.add: (from: Temporal.Instant, days: number) => Temporal.Instant
add
(from, 0.5)
console.log( JSON.stringify( { nextDayUTC: next.toString(), elapsedHours: from.
Temporal.Instant.until(other: Temporal.InstantLike, options?: Temporal.RoundingOptionsWithLargestUnit<Temporal.TimeUnit>): Temporal.Duration (+1 overload)
until
(next).
Temporal.Duration.total(totalOf: Temporal.PluralizeUnit<Temporal.DateUnit | Temporal.TimeUnit>): number (+3 overloads)
total
('hours'),
calendarDays:
const clock: ChronoCore<Temporal.Instant>
clock
.
ChronoCore<Temporal.Instant>.difference: (from: Temporal.Instant, to: Temporal.Instant) => number

Returns the distance from the previous review time to the current time.

difference
(from, next),
fractionalDays:
const fractionalClock: ChronoCore<Temporal.Instant>
fractionalClock
.
ChronoCore<Temporal.Instant>.difference: (from: Temporal.Instant, to: Temporal.Instant) => number

Returns the distance from the previous review time to the current time.

difference
(from, halfDay),
}, null, 2 ) )

March 7 at noon in New York is 17:00 UTC. Adding one local calendar day reaches March 8 at noon, or 16:00 UTC: only 23 hours have elapsed because daylight saving time has started. fractionalDays: true measures the half-day addition as 0.5.