Next.js Discord

Discord Forum

Garbage solution for updating the year displayed in my website needs improvement and needs to work

Answered
Basense posted this in #help-forum
Open in Discord
I want to update my copyright to the current year, so it doesn't have to be done manually every year. (Yeah, I'm lazy, but I also don't want it to ever display some date 6 years ago)
I'd also appreciate to know what date time objects are in ts

Error:
TS2552: Cannot find name 'date'. Did you mean 'Date'?

const localDate: any = date.getFullYear();
const localYear: any = String(localDate);
<span className="basis-1/4">
<p className="text-md">© {localYear} [insert company name] </p>
</span>
Answered by @ts-ignore
new Date().getFullYear()
View full answer

2 Replies