![]() |
trying to get day from date last modified
I need to get the day (Monday, Tuesday, etc) from date last modified code.
This code is working at the moment but not in htye correct format. I would appreciate some help please Code:
<script |
Once again your code is very much out of date! 2000 passed by some years ago and Netscape is one with Nineveh and Tyre.
<script language=javascript> is long deprecated. Use <script type = "text/javascript"> instead (in fact also deprecated but still necessary for IE<9). The <!-- and //--> comment (hiding) tags have not been necessary since IE3 (i.e. since September 1997). If you see these in some published script it is a warning that you are looking at ancient and perhaps unreliable code. One more time - When posting here please help us to help you by following the posting guidelines and wrapping your code in CODE tags. It should be very obvious why this is necessary. This means use the octothorpe or # button on the toolbar. You can (and should) edit your previous post. ln fact the fault is the missing backslash in the closing tag. Review your posts and edit them where necessary. Code:
<span id = "DLM"></span>Frustration - the first time you can't do it the second time. Desperation - the second time you can't do it the first time |
Thank you very much for your code and suggestions. I am trying to teach myself from the internet mainly as my course is by correspondence and we don't get much help from the teachers.
I ran the code above and this is what I received in the program. This page was last updated on 1 12-10-2012 @ 06:47:08. 1. I don't know where the 1 is coming from. 2. I need to get a day like (Monday, Tuesday) coming up according to the last modifed date. 3. I don't need the time. 4. It is a month late as I updated it today (Last modified: Monday, 12 November, 1012). This is the format I am trying to achieve. |
The only reason I can see why you'd be getting 1 instead of Monday is if you left out the line
Code:
d = dy[d]; |
If you don't need the time I have a clever suggestion - leave those lines out!!!
If the month is wrong you have messed with the script and forgotton that in Javascript months are 0-11. Just use the script as I provided it. |
Thank you very much.
I found out the problem. When I copied it, it went into one line so I didn't bring down that line. How do I get it to display on the page? |
Quote:
Code:
document.getElementById("DLM").innerHTML = "This page was last updated on " + lmd + " @ " + lmtm; |
| All times are GMT +1. The time now is 12:31 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.