| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 29802 | 2003-02-03 08:19:00 | Question for HTML geeks... | cheqmaster (635) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 117984 | 2003-02-03 08:19:00 | Hey guys, I want to let visitors know when my site was last updated. I found this piece of code... <font color=#FF0000> <SCRIPT language="JavaScript"><!-- document.write("Site last updated on " + document.lastModified); // --></SCRIPT> </font> which is exactly what I want, only it writes the date the american way, mm/dd/yyyy Is there a way I can make it write the date, dd/mm/yyyy, the way us normal people do? |
cheqmaster (635) | ||
| 117985 | 2003-02-03 08:47:00 | <SCRIPT Language="JavaScript"> <!-- var modDate = new Date(document.lastModified) var modYear = modDate.getYear() if(modYear<1000) modYear+=1900 document.write("Updated: " + modDate.getDate() + "." + (modDate.getMonth()+1) + "." + (modYear+"").substring(2,4)) //--> </SCRIPT> Try this script. It may not be browser compliant so you may need to test it with other browsers. |
Kame (312) | ||
| 1 | |||||