Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I display a date with JavaScript?  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all -

I have a question regarding JavaScript... how do I display a date on a website with JavaScript?

Any help would be great.

Thanks!

- Josh
 
Author and ninkuma
Marshal
Posts: 66729
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not much detail to go on. Where is the date data coming from? Are you using other script on the page? A library such as jQuery? A framework such as AngularJS or React? If not, is the page generated by JSP or some other templating system?

The high-level answer is to format the date as text, then insert the text into the proper location in the DOM. How you best do all that depends on the answers to the above questions.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!