Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140071

How to display specific date format on HTML

$
0
0

How can I go about formatting a date displayed to the user on a website? Basically, I am grabbing the date from a MySQL table and displaying on the website using Nunjucks.

MySQL Code:

CREATE TABLE IF NOT EXISTS `awards` (
  `id` int(11) NOT NULL,
  `awardtime` TIME,
  `awardate` DATE,

HTML Code to display the date and time:

{{ results.awardtime }}
{{ results.awardate }}

Output:
Wed Nov 27 2019 00:00:00 GMT-0800 (PST)

Desired Output (Example):
11-20-2019


Viewing all articles
Browse latest Browse all 140071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>