Help - Search - Members - Calendar
Full Version: html future date
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
trainer4063
I have a web page (an in house web site) and in the text area I have a reference to a date 7 days from today. Rather than having it literally say (7 days from Today) I would like it to give the actual date. example as is : "which will be (7 days from Today). Will that be ". If today is Wednesday, October 24, 2007, would like it to read: "which will be Wednesday, October 31, 2007. Will that be ". I am using NetObjects Fusion 7 and so would like an html code to do this rather than PHP, Javascript, or some other "outside" program to do it.
Darin McGrew
QUOTE
I am using NetObjects Fusion 7 and so would like an html code to do this rather than PHP, Javascript, or some other "outside" program to do it.
HTML can't "do" anything. It's just markup, not a programming language. You'll need something else to figure out when "today + 7 days" is.
trainer4063
Ok, was hoping to have it simple, but Ok. What is going to be the most easily used "something"?
Darin McGrew
What programming experience do you have? What programming languages do you know?
trainer4063
SQL. MSAccess, very little VB, basically database query. I am working with various operating systems with varying application abilities so whatever "language" I use needs to be encompassed in the html.
trainer4063
Found the Solution

<script LANGUAGE="JavaScript">
<!--

var today = new Date();
today.setDate(today.getDate()+7);
document.write(today.toLocaleDateString());

//-->

</SCRIPT>
Darin McGrew
Which works as long as JavaScript is supported and enabled...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.