DATE UTC END OF MONTH
//TODAY is the 16th of OCTOBER 2020
var date = new Date();
var year = date.getMonth() < 11 ? date.getFullYear() : date.getFullYear() + 1;
var month = date.getMonth() < 11 ? date.getMonth() + 1 : 0;
// toUTCString() to display a local time in utc string
console.log(new Date(Date.UTC(year, month)).toUTCString());
//Sun, 01 Nov 2020 00:00:00 GMT
var utcYear = date.getUTCMonth() < 11 ? date.getUTCFullYear() : date.getUTCFullYear() + 1;
var utcMonth = date.getUTCMonth() < 11 ? date.getUTCMonth() + 1 : 0;
// toString() do not change datetime
console.log(new Date(utcYear, utcMonth));
//22 Sun Nov 01 2020 00:00:00 GMT+0100 (Ora standard dell’Europa centrale)
Also in JavaScript:
- import state react
- moving letters animation javascript
- convert object to array javascript
- responce json snippet check postman
- JavaScript Operator Precedence Values
- how to parse json
- how to sent get on react native
- how to use the onload event n vue js
- or operator in javascript
- console.log javascript
- array.includes js
- FAILURE: Build failed with an exception react native android
- using shortid in react lists
- javascript console.table
- delete node between indexes node list js
- share data between livewire and alpine js
- fetch post json
- how er create json data file to train our rasa model
- javascript cehck if array is empty
- adding a variable to a string without using + in javascript
- play iframe video onclick a link javascript
- how to check if object is undefined in javascript
- input output ionic
- jquery get all classes of a div