Skip to Content
๐ŸŽฒ Welcome to RandBox - Powerful JavaScript Random Data Generation Library! Learn More
blogRandBox Module Tour (11/12): time โ€“ Dates and Timezones

RandBox Module Tour (11/12): time โ€“ Dates and Timezones

Overview

  • Units: year/month/weekday/hour/minute/second/millisecond
  • Structures: date/hammertime/timestamp
  • Timezone and AM/PM: timezone/ampm

Examples

import RandBox from 'randbox' const rb = new RandBox() const when = rb.date?.({ year: { min: 1990, max: 2025 } }) const tz = rb.timezone?.()

Links

  • Index: /en/docs/time/
  • Pages: /en/docs/time/date, /en/docs/time/timezone, /en/docs/time/timestamp

FAQ

  • Range constraints for date?
    • Constrain by year/month/day as needed.
  • Difference between timestamp and hammertime?
    • Different representations/units depending on implementation.
Last updated on: