Pezkuwi API
    Preparing search index...

    Class CodecDateNo Inherit Doc

    Date

    A wrapper around seconds/timestamps. Internally the representation only has second precicion (aligning with Rust), so any numbers passed an/out are always per-second. For any encoding/decoding the 1000 multiplier would be applied to get it in line with JavaScript formats. It extends the base JS Date object and has all the methods available that are applicable to any Date

    Hierarchy

    • Date
      • CodecDate

    Implements

    • INumber
    Index
    createdAtHash?: IU8a

    The block at which this value was retrieved/created (set to non-empty when retrieved from storage)

    getVarDate: () => VarDate
    initialU8aLength: number = ...

    The length of the initial encoded value (Only available when the value was constructed from a Uint8Array input)

    isStorageFallback?: boolean

    (internal usage) Indicates that the value was created via a fallback. This is used when with data specified in the metadata when the storage entry is empty.

    With metadata fallback values (available as defaults on most storage entries) any empty storage item should erturn the default. (This is the same as the implementation on the Bizinikiwi runtime)

    registry: Registry

    The registry associated with this object

    • Converts a Date object to a string.

      Parameters

      • hint: "default"

      Returns string

    • Converts a Date object to a string.

      Parameters

      • hint: "string"

      Returns string

    • Converts a Date object to a number.

      Parameters

      • hint: "number"

      Returns number

    • Converts a Date object to a string or number.

      Parameters

      • hint: string

        The strings "number", "string", or "default" to specify what primitive to return.

      Returns string | number

      A number if 'hint' was "number", a string if 'hint' was "string" or "default".

      If 'hint' was given something other than "number", "string", or "default".

    • Parameters

      • Optionalother: unknown

      Returns boolean

      Compares the value of the input to see if there is a match

    • Gets the day-of-the-month, using local time.

      Returns number

    • Gets the day of the week, using local time.

      Returns number

    • Gets the year, using local time.

      Returns number

    • Gets the hours in a date, using local time.

      Returns number

    • Gets the milliseconds of a Date, using local time.

      Returns number

    • Gets the minutes of a Date object, using local time.

      Returns number

    • Gets the month, using local time.

      Returns number

    • Gets the seconds of a Date object, using local time.

      Returns number

    • Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.

      Returns number

    • Gets the difference in minutes between Universal Coordinated Time (UTC) and the time on the local computer.

      Returns number

    • Gets the day-of-the-month, using Universal Coordinated Time (UTC).

      Returns number

    • Gets the day of the week using Universal Coordinated Time (UTC).

      Returns number

    • Gets the year using Universal Coordinated Time (UTC).

      Returns number

    • Gets the hours value in a Date object using Universal Coordinated Time (UTC).

      Returns number

    • Gets the milliseconds of a Date object using Universal Coordinated Time (UTC).

      Returns number

    • Gets the minutes of a Date object using Universal Coordinated Time (UTC).

      Returns number

    • Gets the month of a Date object using Universal Coordinated Time (UTC).

      Returns number

    • Gets the seconds of a Date object using Universal Coordinated Time (UTC).

      Returns number

    • Sets the numeric day-of-the-month value of the Date object using local time.

      Parameters

      • date: number

        A numeric value equal to the day of the month.

      Returns number

    • Sets the year of the Date object using local time.

      Parameters

      • year: number

        A numeric value for the year.

      • Optionalmonth: number

        A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.

      • Optionaldate: number

        A numeric value equal for the day of the month.

      Returns number

    • Sets the hour value in the Date object using local time.

      Parameters

      • hours: number

        A numeric value equal to the hours value.

      • Optionalmin: number

        A numeric value equal to the minutes value.

      • Optionalsec: number

        A numeric value equal to the seconds value.

      • Optionalms: number

        A numeric value equal to the milliseconds value.

      Returns number

    • Sets the milliseconds value in the Date object using local time.

      Parameters

      • ms: number

        A numeric value equal to the millisecond value.

      Returns number

    • Sets the minutes value in the Date object using local time.

      Parameters

      • min: number

        A numeric value equal to the minutes value.

      • Optionalsec: number

        A numeric value equal to the seconds value.

      • Optionalms: number

        A numeric value equal to the milliseconds value.

      Returns number

    • Sets the month value in the Date object using local time.

      Parameters

      • month: number

        A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.

      • Optionaldate: number

        A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.

      Returns number

    • Sets the seconds value in the Date object using local time.

      Parameters

      • sec: number

        A numeric value equal to the seconds value.

      • Optionalms: number

        A numeric value equal to the milliseconds value.

      Returns number

    • Sets the date and time value in the Date object.

      Parameters

      • time: number

        A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.

      Returns number

    • Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • date: number

        A numeric value equal to the day of the month.

      Returns number

    • Sets the year value in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • year: number

        A numeric value equal to the year.

      • Optionalmonth: number

        A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.

      • Optionaldate: number

        A numeric value equal to the day of the month.

      Returns number

    • Sets the hours value in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • hours: number

        A numeric value equal to the hours value.

      • Optionalmin: number

        A numeric value equal to the minutes value.

      • Optionalsec: number

        A numeric value equal to the seconds value.

      • Optionalms: number

        A numeric value equal to the milliseconds value.

      Returns number

    • Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • ms: number

        A numeric value equal to the millisecond value.

      Returns number

    • Sets the minutes value in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • min: number

        A numeric value equal to the minutes value.

      • Optionalsec: number

        A numeric value equal to the seconds value.

      • Optionalms: number

        A numeric value equal to the milliseconds value.

      Returns number

    • Sets the month value in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • month: number

        A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.

      • Optionaldate: number

        A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.

      Returns number

    • Sets the seconds value in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • sec: number

        A numeric value equal to the seconds value.

      • Optionalms: number

        A numeric value equal to the milliseconds value.

      Returns number

    • Returns a date as a string value.

      Returns string

    • Parameters

      • isLe: boolean = false

      Returns `0x${string}`

      Returns a hex string representation of the value

    • Returns string

      Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information

    • Returns a date as a string value in ISO format.

      Returns string

    • Returns a date as a string value appropriate to the host environment's current locale.

      Returns string

    • Converts a date to a string by using the current or specified locale.

      Parameters

      • Optionallocales: string | string[]

        A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

      • Optionaloptions: DateTimeFormatOptions

        An object that contains one or more properties that specify comparison options.

      Returns string

    • Converts a date to a string by using the current or specified locale.

      Parameters

      • Optionallocales: LocalesArgument

        A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

      • Optionaloptions: DateTimeFormatOptions

        An object that contains one or more properties that specify comparison options.

      Returns string

    • Returns a value as a string value appropriate to the host environment's current locale.

      Returns string

    • Converts a date and time to a string by using the current or specified locale.

      Parameters

      • Optionallocales: string | string[]

        A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

      • Optionaloptions: DateTimeFormatOptions

        An object that contains one or more properties that specify comparison options.

      Returns string

    • Converts a date and time to a string by using the current or specified locale.

      Parameters

      • Optionallocales: LocalesArgument

        A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

      • Optionaloptions: DateTimeFormatOptions

        An object that contains one or more properties that specify comparison options.

      Returns string

    • Returns a time as a string value appropriate to the host environment's current locale.

      Returns string

    • Converts a time to a string by using the current or specified locale.

      Parameters

      • Optionallocales: string | string[]

        A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

      • Optionaloptions: DateTimeFormatOptions

        An object that contains one or more properties that specify comparison options.

      Returns string

    • Converts a time to a string by using the current or specified locale.

      Parameters

      • Optionallocales: LocalesArgument

        A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

      • Optionaloptions: DateTimeFormatOptions

        An object that contains one or more properties that specify comparison options.

      Returns string

    • Returns a time as a string value.

      Returns string

    • Parameters

      • Optional_isBare: boolean

      Returns Uint8Array

      Encodes the value as a Uint8Array as per the SCALE specifications

    • Returns a date converted to a string using Universal Coordinated Time (UTC).

      Returns string

    • Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.

      Returns number

    • Returns the number of milliseconds elapsed since midnight, January 1, 1970 Universal Coordinated Time (UTC).

      Returns number

    • Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.

      Parameters

      • s: string

        A date string

      Returns number

    • Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.

      Parameters

      • year: number

        The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.

      • monthIndex: number

        The month as a number between 0 and 11 (January to December).

      • Optionaldate: number

        The date as a number between 1 and 31.

      • Optionalhours: number

        Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.

      • Optionalminutes: number

        Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.

      • Optionalseconds: number

        Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.

      • Optionalms: number

        A number from 0 to 999 that specifies the milliseconds.

      Returns number

    • Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.

      Parameters

      • year: number

        The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.

      • OptionalmonthIndex: number

        The month as a number between 0 and 11 (January to December).

      • Optionaldate: number

        The date as a number between 1 and 31.

      • Optionalhours: number

        Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.

      • Optionalminutes: number

        Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.

      • Optionalseconds: number

        Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.

      • Optionalms: number

        A number from 0 to 999 that specifies the milliseconds.

      Returns number