Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "dates"

Dates

Convert date or date string to specified format.

import { dates } from '@mochen/yuumi';

Index

Functions

Functions

Const format

  • format(param: string | Date, formatStr?: string): string
  • Convert date or date string to specified format.

    example
    dates.format('2020-04-11T13:03:52.000Z');
    // 2020-04-11 21:03:52
    
    dates.format('2019-04-11T13:03:52.000Z','yy*MM(dd  HH.mm.ss.S');
    // 19*04(11  21.03.52.0

    Parameters

    • param: string | Date
    • Default value formatStr: string = "YYYY-MM-DD hh:mm:ss"

    Returns string

Generated using TypeDoc