my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes Date not getting displayed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply locked New topic
Author

Date not getting displayed

prakash ke
Greenhorn

Joined: Apr 20, 2011
Posts: 7
I have a html page wherein i want to the date. If I open the html file with any browser it's displaying correctly. But when I put it in server it's not working.

My script goes like this

<P>Payment is due on <script type="text/javascript">
<!--
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
document.write(month + "/" + day + "/" + year)
//-->
</script>.</P>

Maks Besida
Greenhorn

Joined: May 26, 2011
Posts: 13

Emm, how it relates to JSF?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Okay. When you use a browser to display the HTML containing that Javascript, you see the date displayed. But now you did something else ("put it in server" -- what does that mean?) and now there's some kind of a problem.

So the next thing you should do is to explain what you did, what the problem is, and why it's a problem. Right now we have no idea what you did for a start.

Edit: I agree with Maks, I don't see what JSF has to do with this. Although it might turn out that JSF is part of the problem description, when we find out what it is. In the meantime I will move this to the HTML forum.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Duplicate: http://www.coderanch.com/t/552299/HTML-JavaScript/Date-not-getting-displayed

Close this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date not getting displayed
 
Similar Threads
Date comparision
to fetch multiple ids
Add days to date() calculations
Date not getting displayed
VERY urgent help me please