I have a date '12/12/1955 12:00:00 AM'stored in a hidden column. I want to display the date without time. How do I do this?
'12/12/1955 12:00:00 AM'
Divide it into spaceand take the first part as shown below. Hope this helps you.
space
var d = '12/12/1955 12:00:00 AM'; d = d.split(' ')[0]; console.log(d);
Divide this line into an object Date:
Date
var myDate = new Date('12/12/1955 12:00:00 AM');
Then use the usual methods to get the day / month / year date .
, , :
new Date(<your-date-object>.toDateString());
: :
new Date(new Date().toDateString());
gives: Thu July 11, 2019 00:00:00 GMT-0400 (Eastern Daylight Time)
Source: https://habr.com/ru/post/1623760/More articles:Why is this piece of Swift code compiled? How it works? - xcodeElixir plug: register_before_send - elixirWhat does this javascript function do? - javascriptAPI 365 REST API call from .net console application - c #Как вызвать REST API из консольного приложения? - c#Why do some php classes have an empty init () method? - phpError: cannot "file" or "directory". / lib / React when used with webpack - javascriptbuildFinished and buildStarted will not work - javaHow do multiple hidden layers in a neural network improve its ability to learn? - deep-learningErrors while trying to install fiber node - javascriptAll Articles