Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System date automatic? 1

Status
Not open for further replies.

nelljack

Technical User
Dec 23, 2001
337
US
Is there a way to get the system date coded into my web page? All of my books do not list anything? Or is this something I might have to use awk,sed, etc to create a gif file everytime and upload?

Any help is appreciated.
 
to get the system date, you can use javascript, this is how:
Code:
var date = new Date();
document.write(date);
// this returns the date and time, in the format like this, 
// for example : Tue Feb 19 15:46:06 EST 2002
if you want just the date, for example : MM/DD/YY, just tell me. The pen is mightier than the sword.
 
Thank you very much Dookie2k2! I like the full date.
 
I'm back. I added the code to my web code and it just shows the text on the screen. I'm new to web pages, so how do I get this to come up as a date? I do not know how to do JAVA. Please let me know. TIA.
 
o whoops, sorry about that, enclose it in <script> tags..like this:
Code:
<script language=&quot;javascript&quot;><!--
var date = new Date();
document.write(date);
//--></script>
The pen is mightier than the sword.
 
Works good. I also checked out &quot;java scripts getdate&quot; on a web search and found one that has a few more lines. I tried it and the date output displays the word &quot;output&quot; just before the date. Is that because java coding has this built in?

I have some code I did a long time ago that is so bloated with the same coding, like font, size, color all being the same. I'd like to be able to put these lines in my css file and then label those areas with the tags )not familiar yet with the terminolgy, but one I have looks like this in css a:hover
then all of the attributes are inside curly brackets.

Thanks again.

 
do the tag or tag names..like this:
TEXTAREA,INPUT {color:white;}

or for just one
TEXTAREA {color:white}

is that what you mean? Suceess, thats the way you spell success!
 
By your last example with

TEXTAREA,INPUT {color:white;}

does that mean I can put all of my same coding into one css line? If so, that would be great! Like this:

TEXTAREA,INPUT,HOVER,JUNK {color:white;}

I am learning css at this time. Not familiar with how to get those duplicates into it, then reference them to the main html file. My books must be old, even though one is HTML 4, but I haven't found examples yet. Maybe I'm looking up the wrong terms. Anyway, it's fun to learn some new things as I go.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top