1.0.0 • Published 4 years ago

@geeeger/date-utils v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 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(':'))