New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aqzhyi/dayjs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aqzhyi/dayjs

```ts import { dayjs } from '@aqzhyi/dayjs'

  • 0.9.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Usage

```ts
import { dayjs } from '@aqzhyi/dayjs'

dayjs(1704038400)           // pass 10-digit Unix Timestamp including seconds OK
dayjs(1704038400_000)       // pass 13-digit Unix Timestamp including milliseconds OK
dayjs(1704038400_000_000)   // pass 16-digit Unix Timestamp including wtf? OK

dayjs(1704038400).time()         // return 1704038400000
dayjs(1704038400_000).unix()     // return 1704038400

// wtf?
dayjs(1704038400_000_000).time() // return 1704038400000
dayjs(1704038400_000_000).unix() // return 1704038400
```

```ts
dayjs('1704038400')         // OK
dayjs('1704038400_000')     // OK
dayjs('1704038400_000_000') // OK
dayjs('1704038400e3')       // OK
dayjs('1704038400e6')       // OK
```

```ts
dayjs().setTime(-1).format('HH:mm:ss')         // '00:00:00'
dayjs().setTime(0).format('HH:mm:ss')          // '00:00:00'
dayjs().setTime(6.15).format('HH:mm:ss')       // '06:15:00'
dayjs().setTime(6.3).format('HH:mm:ss')        // '06:30:00'
dayjs().setTime(6.45).format('HH:mm:ss')       // '06:45:00'
dayjs().setTime(6.5).format('HH:mm:ss')        // '06:50:00'
dayjs().setTime(6.59).format('HH:mm:ss')       // '06:59:00'
dayjs().setTime(6.77).format('HH:mm:ss')       // '06:59:59'
dayjs().setTime(23.59).format('HH:mm:ss')      // '23:59:00'
dayjs().setTime(23.5959).format('HH:mm:ss')    // '23:59:59'
dayjs().setTime(24).format('HH:mm:ss')         // '23:59:59'

dayjs().setTime('-1').format('HH:mm:ss')       // '00:00:00'
dayjs().setTime('0').format('HH:mm:ss')        // '00:00:00'
dayjs().setTime('6:15').format('HH:mm:ss')     // '06:15:00'
dayjs().setTime('6:3').format('HH:mm:ss')      // '06:30:00'
dayjs().setTime('6:45').format('HH:mm:ss')     // '06:45:00'
dayjs().setTime('6:5').format('HH:mm:ss')      // '06:50:00'
dayjs().setTime('6:59').format('HH:mm:ss')     // '06:59:00'
dayjs().setTime('6:77').format('HH:mm:ss')     // '06:59:59'
dayjs().setTime('23:59').format('HH:mm:ss')    // '23:59:00'
dayjs().setTime('23:5959').format('HH:mm:ss')  // '23:59:59'
dayjs().setTime('24').format('HH:mm:ss')       // '23:59:59'
```

```ts
const now = dayjs()
now.formatDate()            // '2023/01/01'
now.formatDateTime()        // '2023/01/01 00:00'
now.formatDateTimeSeconds() // '2023/01/01 00:00:00'
```

> 我是誰?我在哪?我在這裡幹嘛?

Keywords

FAQs

Package last updated on 16 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc