Get the current year for either UTC or specific timezone(s).
NPM
npm i currentyear-api-wrapper@latest
CDN (no installation required)
<script src="https://unpkg.com/currentyear-api-wrapper"></script>
You will most likely be using the CurrentYearService
which you can import as:
import { CurrentYearService } from "currentyear-api-wrapper";
const service = new CurrentYearService();
service.getCurrentYear("America/New_York").then(console.log); // e.g. "2022"
- View the demo here
- Documentation is generated using TypeDoc and it's available at https://arlopezg.github.io/currentyear-api-wrapper/docs/
In the words of the wise Adam Greenough,
Where is the NPM package?
Don't tempt me.
Well, I was tempted.