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

Dynamic new year date #10

Open
OmarAlareeki opened this issue Jul 19, 2021 · 1 comment
Open

Dynamic new year date #10

OmarAlareeki opened this issue Jul 19, 2021 · 1 comment

Comments

@OmarAlareeki
Copy link

The string for the new year "1 Jan 2021" is not day dynamic which is not a good idea of coding in JS.
I tried it this way:
const currentYearEve = "31 Dec " + new Date().getFullYear();

@EL-MEHDI-ESSAADI
Copy link

I did that: let endDateInMeliSec = Date.UTC(new Date().getFullYear(), new Date().getMonth() + 2, 5, 22, 44);

Date.UTC is a method that we give it a UTC date and it return for us the number of meliseconds

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