Skip to content

How to install utc & timezone plugin? #2841

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

Open
The-LukeZ opened this issue Mar 13, 2025 · 2 comments
Open

How to install utc & timezone plugin? #2841

The-LukeZ opened this issue Mar 13, 2025 · 2 comments

Comments

@The-LukeZ
Copy link

I don't know how to install specific plugins.

The docs only provide an answer on how to use them, but not on how to install them.
I want to use timezone and utc e.g.

Image

@thadeucity
Copy link

thadeucity commented Mar 15, 2025

// YARN
yarn add dayjs

// NPM
npm i dayjs

After that you just import and extend

import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';

dayjs.extend(utc);
dayjs.extend(timezone);

dayjs.tz.setDefault('Asia/Tokyo');

dayjs.utc().format('YYYY-MM-DD HH:mm:ssZ');

@The-LukeZ
Copy link
Author

aight, I will try it out. But I did install dayjs with npm install dayjs and the plugins were not found.

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

2 participants