SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    jbm
    SitePoint Community Guest
    Last week I came across a problem in Netscape. I used a simple JavaScript to show the date my page was last modified:

    <SCRIPT language="JavaScript">
    <!---
    document.write('Last modified: ')
    document.write(document.lastModified)

    // -->
    </SCRIPT>

    it shows correctly in IE, but not Netscape. After Dec. 31 in Netscape all I see is "Last modified on Jan 1, 1970". The problem seems to only arise with .cfm flies (Cold Fusion Templates), but not when I save files as HTML. Has anybody else seen this before? Am I just overlooking something? If you know why this is happening or if you know the workaround for this problem please let me know. Your help is appreciated.

    jbm

  2. #2
    Destiny Manager Plebius's Avatar
    Join Date
    Nov 1999
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this might work.


    var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    var name = navigator.appName.toLowerCase();
    var modi = document.LastModified;
    if ((name.indexOf("netscape") && document.location.indexof(".cfm"))
    {
    var textdate = months[modi.getMonth()] + modi.getDate() + ',' + (theDate.getYear() + 1900);
    }



  3. #3
    jbm
    SitePoint Community Guest
    LuZeR,
    thanks for a fast reply. That code didn't seem to work. In Netscape, of course... IE works fine, Netscape still 'thinks' its Jan 1, 1970. (The weird thing is, it stayed on Jan 1, 1970 for a few days)

    I think I might end up using a Cold Fusion function to get date, but I won't sleep until I figure this one out.... So anyone out there with suggestions, please say something!

    thank you
    jbm

  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What version of Navigator are you using??? maybe you should try updating to 4.7 nd javascript 1.3 to see if the problem is fixed. Sounds like a Y2K glitch in the interpreting engine for javascript.

    ------------------
    Wayne Luke

    The Majormud Encyclopedia - www.bloodquest2.com
    Come Play one of the hottest games on the net.


  5. #5
    jbm
    SitePoint Community Guest
    I do have Netscape 4.7. It looked like a Y2K glitch at first, but the date always stays at Jan 1, 1970 and it's confusing me a little bit... I'll keep trying - maybe I can come up with something to fix it...
    jbm

  6. #6
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Have you "modified" the document??? Just open and save it again. See if the date changes. Also make a few test documents and force their modified dates to various values some before and some after the new year.

    ------------------
    Wayne Luke

    The Majormud Encyclopedia - www.bloodquest2.com
    Come Play one of the hottest games on the net.


  7. #7
    jbm
    SitePoint Community Guest
    I tried that, and I still get the same error. It has something to do with ColdFusion, though, because it works fine with HTML documents. Maybe I should see what Netscape Y2K team has to tell me about this one

    thanks for your help, guys. If you have any additional thoughts, your input is more than welcome, and if I find an answer I will post it here.

    jbm


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •