SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Sports Publisher mjames's Avatar
    Join Date
    Jan 2000
    Location
    Charlotte, NC
    Posts
    5,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One of the small things that has bugged me with my site is the date script doesn't show up in Netscape. I'm talking about the one below the logo on the black bar. It looks fine in IE. If anyone could offer a solution, I would appreciate it!

  2. #2
    SitePoint Guru CJ's Avatar
    Join Date
    Apr 2000
    Location
    Mechelen, Belgium, Europe
    Posts
    684
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use SSI if your server supports it... http://freesources.net/authoring/ssi/reference.htm

    Hope this helps

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here is an excellent Javascript that works cross-browser.

    <script language="javascript">
    var now = new Date();
    var month = "";
    var year = "";
    var date = now.getDate();
    if (now.getMonth() == 0) month = "Jan"
    if (now.getMonth() == 1) month = "Feb"
    if (now.getMonth() == 2) month = "March"
    if (now.getMonth() == 3) month = "April"
    if (now.getMonth() == 4) month = "May"
    if (now.getMonth() == 5) month = "June"
    if (now.getMonth() == 6) month = "July"
    if (now.getMonth() == 7) month = "Aug"
    if (now.getMonth() == 8) month = "Sept"
    if (now.getMonth() == 9) month = "Oct"
    if (now.getMonth() == 10) month = "Nov"
    if (now.getMonth() == 11) month = "Dec"
    year = now.getYear();
    document.write( month + " " + date + ", 2000" + "<br>")
    // -->
    </script>

    The output of this script is as so:

    Dec 16, 2000note, you can of course customize the month portion of the script if you want full month names.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    SitePoint Guru CJ's Avatar
    Join Date
    Apr 2000
    Location
    Mechelen, Belgium, Europe
    Posts
    684
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But such a javaScript is enormous bloat compared to the SSI... If your server supports SSI you should use SSI instead...

  5. #5
    Sports Publisher mjames's Avatar
    Join Date
    Jan 2000
    Location
    Charlotte, NC
    Posts
    5,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by CJ
    You could use SSI if your server supports it... http://freesources.net/authoring/ssi/reference.htm

    Hope this helps
    I already use SSI throughout the site, and of course it supports it (I use .shtml extensions). Thanks, Creole for the suggestion, I'll look into it.

  6. #6
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Eugene, OR
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're interested in using PHP, then you can use the following:

    <?php
    $today = date("F j, Y");
    PRINT "$today";
    ?>

    It will print out: December 16, 2000 (Or whatever the day is).

    Nice and small isn't it? I was using a Javascript, but it was much larger, so I switched it. Plus, I use PHP already on my pages, so I didn't have to change the file extensions in order to use it.

    Take Care,

    Adam

  7. #7
    SitePoint Addict
    Join Date
    Oct 2000
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One side note... the JavaScript will return the date/time of the user's system; the ssi, whatever you send off the server.

  8. #8
    Sports Publisher mjames's Avatar
    Join Date
    Jan 2000
    Location
    Charlotte, NC
    Posts
    5,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by etLux
    One side note... the JavaScript will return the date/time of the user's system; the ssi, whatever you send off the server.
    So which would you recommend I use?

    And adam_shep, I would have to change all my extensions on my site if I were to use that PHP, so that won't work.


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
  •