Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/atulin/forged/llms.txt

Use this file to discover all available pages before exploring further.

ForgeTemporal groups all date and time generation under the f.Temporal accessor. It covers all five temporal types in modern .NET — DateTime, DateOnly, TimeOnly, DateTimeOffset, and TimeSpan — and provides between, past, and future variants where applicable so you can express temporal intent directly without manually computing bounds. When a boundary is omitted (passed as null), the method falls back to a sensible default: Past and Future methods default to a one-year window relative to UtcNow, while unconstrained Between methods fall back to the type’s absolute MinValue / MaxValue.
Note on DateTime kind — all generated DateTime values use DateTimeKind.Utc. Similarly, all DateTimeOffset values are generated with a UTC offset of TimeSpan.Zero.

Between

Produces a random DateTime anywhere within the supplied [min, max] window.
public Generator<DateTime> Between(DateTime? min = null, DateTime? max = null)
min
DateTime?
The earliest possible value (inclusive). Defaults to DateTime.MinValue when null.
max
DateTime?
The latest possible value (inclusive). Defaults to DateTime.MaxValue when null.
returns
Generator<DateTime>
A random DateTime (UTC) within the specified range.
Example
CreatedAt = f => f.Temporal.Between(
    new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc),
    new DateTime(2024, 12, 31, 23, 59, 59, DateTimeKind.Utc)
),

Past

Produces a random DateTime between earliest and DateTime.UtcNow.
public Generator<DateTime> Past(DateTime? earliest = null)
earliest
DateTime?
The lower bound of the generated range. When null, defaults to approximately one year before the current UTC time.
returns
Generator<DateTime>
A random DateTime (UTC) no later than the moment the value is generated.
Example
// Any date within the past year
LastLoginAt = f => f.Temporal.Past(),

// Any date since the system launch
RegistrationDate = f => f.Temporal.Past(
    earliest: new DateTime(2019, 6, 1, 0, 0, 0, DateTimeKind.Utc)
),

Future

Produces a random DateTime between DateTime.UtcNow and latest.
public Generator<DateTime> Future(DateTime? latest = null)
latest
DateTime?
The upper bound of the generated range. When null, defaults to approximately one year after the current UTC time.
returns
Generator<DateTime>
A random DateTime (UTC) no earlier than the moment the value is generated.
Example
ExpiresAt      = f => f.Temporal.Future(),
ScheduledUntil = f => f.Temporal.Future(
    latest: new DateTime(2030, 1, 1, 0, 0, 0, DateTimeKind.Utc)
),

DateBetween

Produces a random DateOnly within a [min, max] range (no time component).
public Generator<DateOnly> DateBetween(DateOnly? min = null, DateOnly? max = null)
min
DateOnly?
The earliest date (inclusive). Defaults to DateOnly.MinValue when null.
max
DateOnly?
The latest date (inclusive). Defaults to DateOnly.MaxValue when null.
returns
Generator<DateOnly>
A random DateOnly within the specified range.
Example
BirthDate = f => f.Temporal.DateBetween(
    new DateOnly(1950, 1, 1),
    new DateOnly(2005, 12, 31)
),

DateInPast

Produces a random DateOnly between earliest and today’s UTC date.
public Generator<DateOnly> DateInPast(DateOnly? earliest = null)
earliest
DateOnly?
The lower date bound. When null, defaults to approximately one year before today.
returns
Generator<DateOnly>
A random past DateOnly no later than today’s UTC date.
Example
InvoiceDate  = f => f.Temporal.DateInPast(),
ContractDate = f => f.Temporal.DateInPast(new DateOnly(2022, 1, 1)),

DateInFuture

Produces a random DateOnly from today’s UTC date up to latest.
public Generator<DateOnly> DateInFuture(DateOnly? latest = null)
latest
DateOnly?
The upper date bound. When null, defaults to approximately one year from today.
returns
Generator<DateOnly>
A random future DateOnly no earlier than today’s UTC date.
Example
RenewalDate  = f => f.Temporal.DateInFuture(),
DeadlineDate = f => f.Temporal.DateInFuture(new DateOnly(2027, 12, 31)),

TimeBetween

Produces a random TimeOnly within a [min, max] range.
public Generator<TimeOnly> TimeBetween(TimeOnly? min = null, TimeOnly? max = null)
min
TimeOnly?
The earliest time (inclusive). Defaults to TimeOnly.MinValue (00:00:00) when null.
max
TimeOnly?
The latest time (inclusive). Defaults to TimeOnly.MaxValue (23:59:59.9999999) when null.
returns
Generator<TimeOnly>
A random TimeOnly within the specified range.
Example
// Business hours only
AppointmentTime = f => f.Temporal.TimeBetween(
    new TimeOnly(9, 0),
    new TimeOnly(17, 0)
),

DateTimeOffsetBetween

Produces a random DateTimeOffset within a [min, max] window. Generated values always carry a UTC offset of TimeSpan.Zero.
public Generator<DateTimeOffset> DateTimeOffsetBetween(DateTimeOffset? min = null, DateTimeOffset? max = null)
min
DateTimeOffset?
The earliest offset date/time (inclusive). Defaults to DateTimeOffset.MinValue when null.
max
DateTimeOffset?
The latest offset date/time (inclusive). Defaults to DateTimeOffset.MaxValue when null.
returns
Generator<DateTimeOffset>
A random DateTimeOffset (UTC offset zero) within the specified range.
Example
EventTimestamp = f => f.Temporal.DateTimeOffsetBetween(
    DateTimeOffset.UtcNow.AddYears(-2),
    DateTimeOffset.UtcNow
),

DateTimeOffsetInPast

Produces a random DateTimeOffset between earliest and DateTimeOffset.UtcNow.
public Generator<DateTimeOffset> DateTimeOffsetInPast(DateTimeOffset? earliest = null)
earliest
DateTimeOffset?
Lower bound of the range. When null, defaults to approximately one year before now.
returns
Generator<DateTimeOffset>
A random past DateTimeOffset (UTC) no later than the current moment.
Example
AuditTimestamp = f => f.Temporal.DateTimeOffsetInPast(),

DateTimeOffsetInFuture

Produces a random DateTimeOffset between DateTimeOffset.UtcNow and latest.
public Generator<DateTimeOffset> DateTimeOffsetInFuture(DateTimeOffset? latest = null)
latest
DateTimeOffset?
Upper bound of the range. When null, defaults to approximately one year from now.
returns
Generator<DateTimeOffset>
A random future DateTimeOffset (UTC) no earlier than the current moment.
Example
TokenExpiry = f => f.Temporal.DateTimeOffsetInFuture(),

TimeSpanBetween

Produces a random TimeSpan duration within a [min, max] range.
public Generator<TimeSpan> TimeSpanBetween(TimeSpan? min = null, TimeSpan? max = null)
min
TimeSpan?
The shortest duration (inclusive). Defaults to TimeSpan.MinValue when null.
max
TimeSpan?
The longest duration (inclusive). Defaults to TimeSpan.MaxValue when null.
returns
Generator<TimeSpan>
A random TimeSpan within the specified range.
SessionDuration = f => f.Temporal.TimeSpanBetween(
    TimeSpan.FromMinutes(1),
    TimeSpan.FromHours(2)
),

Build docs developers (and LLMs) love