Apicat Docs
  1. Dynamic values Modules
Apicat Docs
  • What is Apicat?
  • Send requests
    • Create requests
      • Request basics
      • Parameters and body
      • Request headers
      • Request settings
      • Dynamic values
      • HTTP/2
      • SOAP/WebService
    • Authentication and authorization
      • Overview
      • CA and client certificates
      • Authorization types supported by Apidog
      • Digest Auth
      • OAuth 1.0
      • OAuth 2.0
      • Hawk Authentication
      • Kerberos
      • NTLM
      • Akamai EdgeGrid
    • Response and cookies
      • Overview
      • API response in Apidog
      • Create and send cookies
      • Debug requests
    • Dynamic values Modules
      • Airline
      • Animal
      • Color
      • Commerce
      • Company
      • Database
      • Datatype
      • Date
      • Finance
      • Food
      • Git
      • Hacker
      • Helpers
      • Image
      • Internet
      • Location
      • Lorem
      • Music
      • Number
      • Person
      • Phone
      • Science
      • String
      • System
      • Vehicle
      • Word
  • Environments & variables
    • Overview
    • Using variables
    • Environments & services
  • Pre/Post processors
    • Overview
    • Assertion
    • Extract variable
    • Wait
    • Database operations
      • Overview
      • MySQL
      • MongoDB
      • Redis
      • Oracle Client
    • Using scripts
      • Overview
      • Pre processor scripts
      • Post processor scripts
      • Public scripts
      • Postman scripts reference
      • Calling other programming languages
      • Using JS libraries
      • Visualizing responses
      • Script examples
        • Assertion scripts
        • Using variables in scripts
        • Using scripts to modify request messages
        • Other examples
  • Best practices
    • How to handle API signatures
    • How to access OAuth 2.0 protected APIs
    • Apidog collaboration workflow
    • Managing authentication state in Apidog
  • Account & preferences
    • Account settings
    • Generate OpenAPI access token
    • Language settings
    • Hot keys
    • Network proxy configuration
    • Data backup
    • Updating Apidog
    • Deleting account
    • Experimental Features
  • References
    • API-Design First Approach
    • Apidog OpenAPI/Swagger Specificaiton Extensions
    • JSONPath
    • XPath
    • Regular Expressions
    • JSON Schema
    • CSV File Format
    • Install Java Environment
    • Runner deployment environment
    • Apidog flavored Markdown
  1. Dynamic values Modules

Date

Module to generate dates.
Overview
To quickly generate a date in the past, use recent() (last day) or past() (last year). To quickly generate a date in the future, use soon() (next day) or future() (next year). For a realistic birthdate for an adult, use birthdate().
For more control, any of these methods can be customized with further options, or use between() to generate a single date between two dates, or betweens() for multiple dates.
You can generate random localized month and weekday names using month() and weekday().

anytime#

Generates a random date that can be either in the past or in the future.
Parameters
NameTypeDefaultDescription
refDatestring | number | Date{{$date.now}}The date to use as reference point for the newly generated date.
Returns: Date
Examples

between#

Generates a random date between the given boundaries.
Parameters
NameTypeDefaultDescription
fromstring | number | DateThe early date boundary.
tostring | number | DateThe late date boundary.
Returns: Date
Examples

betweens#

Generates random dates between the given boundaries. The dates will be returned in an array sorted in chronological order.
Parameters
NameTypeDefaultDescription
countnumber | { min: number; max: number; }3The number of dates to generate.
fromstring | number | DateThe early date boundary.
tostring | number | DateThe late date boundary.
Returns: Date
Examples

birthdate#

Returns a random birthdate. By default, the birthdate is generated for an adult between 18 and 80 years old. But you can customize the 'age' range or the 'year' range to generate a more specific birthdate.
Parameters
NameTypeDefaultDescription
refDatestring | number | Date{{$date.now}}The date to use as reference point for the newly generated date.
maxnumberThe maximum age/year to generate a birthdate for/in.
minnumberThe minimum age/year to generate a birthdate for/in.
mode'age' | 'year'Either 'age' or 'year' to generate a birthdate based on the age or year range.
refDatestring | number| Date{{$date.now}}The date to use as reference point for the newly generated date. Only used when mode is 'age'.
Returns: Date
Examples

future#

Generates a random date in the future.
Parameters
NameTypeDefaultDescription
refDatestring | number | Date{{$date.now}}The date to use as reference point for the newly generated date.
yearsnumber1The range of years the date may be in the future.
Returns: Date
Examples

month#

Returns a random name of a month.
Parameters
NameTypeDefaultDescription
abbreviatedbooleanfalseWhether to return an abbreviation.
contextbooleanfalseWhether to return the name of a month in the context of a date. In the default en locale this has no effect, however, in other locales like fr or ru, this may affect grammar or capitalization, for example 'январь' with { context: false } and 'января' with { context: true } in ru.
Returns: Date
Examples

past#

Generates a random date in the past.
Parameters
NameTypeDefaultDescription
refDatestring | number | Date{{$date.now}}The date to use as reference point for the newly generated date.
yearsnumber1The range of years the date may be in the past.
Returns: Date
Examples

recent#

Generates a random date in the recent past.
Parameters
NameTypeDefaultDescription
daysnumber1The range of days the date may be in the past.
refDatestring | number | Date{{$date.now}}The date to use as reference point for the newly generated date.
Returns: Date
Examples

soon#

Generates a random date in the near future.
Parameters
NameTypeDefaultDescription
daysnumber1The range of days the date may be in the future.
refDatestring | number | Date{{$date.now}}The date to use as reference point for the newly generated date.
Returns: Date
Examples

timeZone#

Returns a random IANA time zone name.
The returned time zone is not tied to the current locale.
Returns: string
Examples

weekday#

Returns a random day of the week.
Parameters
NameTypeDefaultDescription
abbreviatedbooleanfalseWhether to return an abbreviation.
contextbooleanfalseWhether to return the day of the week in the context of a date. In the default en locale this has no effect, however, in other locales like fr or ru, this may affect grammar or capitalization, for example 'Lundi' with { context: false } and 'lundi' with { context: true } in fr.
Returns: string
Examples

Modified at 2025-06-25 07:57:16
Previous
Datatype
Next
Finance
Built with