Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localized time format is not correct #1671

Open
web-programmer-here opened this issue Oct 19, 2021 · 0 comments
Open

localized time format is not correct #1671

web-programmer-here opened this issue Oct 19, 2021 · 0 comments

Comments

@web-programmer-here
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant