1.0.0 • Published 5 years ago

@geeeger/date-utils v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@geeeger/date-utils

methods

getGMT8LocalDate

import { getGMT8LocalDate } from '@geeeger/date-utils'

const unixTimestamp = Math.floor(Date.now() / 1000)

const date = getGMT8LocalDate(unixTimestamp)

console.log([date.getFullYear(), date.getMonth(), date.getDate()].join('.'))
console.log([date.getHours(), date.getMinutes(), date.getSeconds()].join(':'))