iamkun / iamkun/dayjs

localized time format is not correct

Open
#1,671 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I am trying to get the local time based on time zone and language but it is not working

```
dayjs().locale('zh-cn').tz('Asia/Hong_Kong').format("LT")
```

Should print something like this : `02:10` but it prints `2:10 AM` - AM and PM is not used in Hong Kong

In moment this is possible:
http://jsfiddle.net/j0pf89u6/

```
moment.locale('zh-cn');
var now = moment().tz('Asia/Hong_Kong').format("LT")
console.log(now);
// 02:10
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.