This is the latest docs version
Quick Links
  • -Overview
  • -Language Features
  • -JS Interop
  • -Build System
Documentation
Language Manual
Reference for all language features
ReScript & React
First class bindings for ReactJS
GenType
Seamless TypeScript integration
Reanalyze
Dead Code & Termination analysis
Exploration
Packages
Explore third party libraries and bindings
Syntax Lookup
Discover all syntax constructs
APIPlaygroundBlogCommunity
  • Playground
  • Blog
  • Twitter
  • GitHub
  • Forum
Core Module
Overview
Core
submodules
  • Array
  • ArrayBuffer
  • AsyncIterator
  • BigInt
  • BigInt64Array
    • Constants
    BigUint64Array
    • Constants
  • Console
  • DataView
  • Date
    • UTC
  • Dict
  • Error
    • URIError
    • TypeError
    • SyntaxError
    • ReferenceError
    • RangeError
    • EvalError
  • Exn
  • Float
    • Constants
    Float32Array
    • Constants
    Float64Array
    • Constants
    Int
    • Constants
    Int16Array
    • Constants
    Int32Array
    • Constants
    Int8Array
    • Constants
  • Internal
  • Intl
    • Segments
    • Segmenter
    • RelativeTimeFormat
    • PluralRules
    • NumberFormat
      • Grouping
    • Locale
    • ListFormat
    • DateTimeFormat
      • t
        t
      • t
        dateStyle
      • t
        timeStyle
      • t
        dayPeriod
      • t
        weekday
      • t
        era
      • t
        year
      • t
        month
      • t
        day
      • t
        hour
      • t
        minute
      • t
        second
      • t
        timeZoneName
      • t
        hourCycle
      • t
        formatMatcher
      • t
        fractionalSecondDigits
      • t
        options
      • t
        resolvedOptions
      • t
        supportedLocalesOptions
      • t
        dateTimeComponent
      • t
        dateTimePart
      • t
        dateTimeRangeSource
      • t
        dateTimeRangePart
      • v
        make
      • v
        supportedLocalesOf
      • v
        resolvedOptions
      • v
        format
      • v
        formatToParts
      • v
        formatRange
      • v
        formatRangeToParts
    • Collator
    • Common
  • Iterator
  • JSON
    • Decode
    • Encode
    • Classify
  • List
  • Map
  • MapperRt
  • Math
    • Int
    • Constants
  • Null
  • Nullable
  • Object
  • Option
  • Ordering
  • Promise
  • Re
    • Result
    RegExp
    • Result
  • Result
  • Set
  • String
  • Symbol
  • Type
    • Classify
  • TypedArray
  • Uint16Array
    • Constants
    Uint32Array
    • Constants
    Uint8Array
    • Constants
    Uint8ClampedArray
    • Constants
  • WeakMap
  • WeakSet
  • API / Core / Intl / Datetimeformat

    DateTimeFormat

    t

    RESCRIPT
    type t

    dateStyle

    RESCRIPT
    type dateStyle = [#full | #long | #medium | #short]

    timeStyle

    RESCRIPT
    type timeStyle = [#full | #long | #medium | #short]

    dayPeriod

    RESCRIPT
    type dayPeriod = [#long | #narrow | #short]

    weekday

    RESCRIPT
    type weekday = [#long | #narrow | #short]

    era

    RESCRIPT
    type era = [#long | #narrow | #short]

    year

    RESCRIPT
    type year = [#"2-digit" | #numeric]

    month

    RESCRIPT
    type month = [ | #"2-digit" | #long | #narrow | #numeric | #short ]

    day

    RESCRIPT
    type day = [#"2-digit" | #numeric]

    hour

    RESCRIPT
    type hour = [#"2-digit" | #numeric]

    minute

    RESCRIPT
    type minute = [#"2-digit" | #numeric]

    second

    RESCRIPT
    type second = [#"2-digit" | #numeric]

    timeZoneName

    RESCRIPT
    type timeZoneName = [ | #long | #longGeneric | #longOffset | #short | #shortGeneric | #shortOffset ]

    Firefox also supports IANA time zone names here Node v19+ supports "shortOffset", "shortGeneric", "longOffset", and "longGeneric".

    hourCycle

    RESCRIPT
    type hourCycle = [#h11 | #h12 | #h23 | #h24]

    formatMatcher

    RESCRIPT
    type formatMatcher = [#basic | #bestFit]

    fractionalSecondDigits

    RESCRIPT
    type fractionalSecondDigits = [#0 | #1 | #2 | #3]

    options

    RESCRIPT
    type options = { dateStyle?: dateStyle, timeStyle?: timeStyle, calendar?: Core__Intl__Common.calendar, dayPeriod?: dayPeriod, numberingSystem?: Core__Intl__Common.numberingSystem, localeMatcher?: Core__Intl__Common.localeMatcher, timeZone?: string, hour12?: bool, hourCycle?: hourCycle, formatMatcher?: formatMatcher, weekday?: weekday, era?: era, year?: year, month?: month, day?: day, hour?: hour, minute?: minute, second?: second, fractionalSecondDigits?: fractionalSecondDigits, timeZoneName?: timeZoneName, }

    resolvedOptions

    RESCRIPT
    type resolvedOptions = { dateStyle?: dateStyle, timeStyle?: timeStyle, weekday?: weekday, era?: era, year?: year, month?: month, day?: day, hour?: hour, minute?: minute, second?: second, fractionalSecondDigits?: fractionalSecondDigits, timeZoneName?: timeZoneName, calendar: Core__Intl__Common.calendar, hour12: bool, hourCycle: hourCycle, locale: string, numberingSystem: Core__Intl__Common.numberingSystem, timeZone: string, }

    supportedLocalesOptions

    RESCRIPT
    type supportedLocalesOptions = { localeMatcher: Core__Intl__Common.localeMatcher, }

    dateTimeComponent

    RESCRIPT
    type dateTimeComponent = [ | #day | #dayPeriod | #era | #fractionalSecond | #hour | #literal | #minute | #month | #relatedYear | #second | #timeZone | #weekday | #year | #yearName ]

    dateTimePart

    RESCRIPT
    type dateTimePart = { \"type": dateTimeComponent, value: string, }

    dateTimeRangeSource

    RESCRIPT
    type dateTimeRangeSource = [ | #endRange | #shared | #startRange ]

    dateTimeRangePart

    RESCRIPT
    type dateTimeRangePart = { \"type": dateTimeComponent, value: string, source: dateTimeRangeSource, }

    make

    RESCRIPT
    let make: (~locales: array<string>=?, ~options: options=?) => t

    supportedLocalesOf

    RESCRIPT
    let supportedLocalesOf: (array<string>, ~options: supportedLocalesOptions=?) => t

    resolvedOptions

    RESCRIPT
    let resolvedOptions: t => resolvedOptions

    format

    RESCRIPT
    let format: (t, Core__Date.t) => string

    formatToParts

    RESCRIPT
    let formatToParts: (t, Core__Date.t) => array<dateTimePart>

    formatRange

    RESCRIPT
    let formatRange: ( t, ~startDate: Core__Date.t, ~endDate: Core__Date.t, ) => string

    formatRangeToParts

    RESCRIPT
    let formatRangeToParts: ( t, ~startDate: Core__Date.t, ~endDate: Core__Date.t, ) => array<dateTimeRangePart>
    Types and values
    • t
      t
    • t
      dateStyle
    • t
      timeStyle
    • t
      dayPeriod
    • t
      weekday
    • t
      era
    • t
      year
    • t
      month
    • t
      day
    • t
      hour
    • t
      minute
    • t
      second
    • t
      timeZoneName
    • t
      hourCycle
    • t
      formatMatcher
    • t
      fractionalSecondDigits
    • t
      options
    • t
      resolvedOptions
    • t
      supportedLocalesOptions
    • t
      dateTimeComponent
    • t
      dateTimePart
    • t
      dateTimeRangeSource
    • t
      dateTimeRangePart
    • v
      make
    • v
      supportedLocalesOf
    • v
      resolvedOptions
    • v
      format
    • v
      formatToParts
    • v
      formatRange
    • v
      formatRangeToParts

    © 2024 The ReScript Project

    Software and assets distribution powered by KeyCDN.

    About
    • Community
    • ReScript Association
    Find us on