S
S
Sergey Zolotarev2019-08-04 18:58:39
JavaScript
Sergey Zolotarev, 2019-08-04 18:58:39

Does the Date() object in JavaScript support "Datetime" format?

As I've known for a long time, JavaScript has its own date and time object called . The object body specifies either a date or time, or a date and time in supported formats. And the methods of this object allow you to get information about the time, year and other hourly data .... I did not find answers on the Internet to questions about how you can insert a date and time in the body of this object in the Datetime format (still available in MySQL )...new Date();


I want to apply it as follows (I am currently working with a news update form on a website for a charity foundation, but changing the date and time using an HTML form will still be required (form + script + server application and this is a simple code example)):

var d=new Date('2019-07-31 11:51:35');
var data=d.getYears() +"-"+ d.getMonths() +"-"+ d.getDays() +" "+ d.getHours() +":"+ d.getMinutes() +":"+ d.getSeconds();
console.log(data);

Does the object support the Datetime format ? If this format is not supported, are there solutions to this problem? new Date();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
profesor08, 2019-08-04
@seregazolotaryow64

Supports

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question