Welcome to TalkGraphics.com
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
  1. #11
    Join Date
    Nov 2000
    Location
    Red Boiling Springs TN USA
    Posts
    19,208

    Default Re: Day month year and Filename

    John try the following code.

    Code:
     
    <script type="text/javascript"><!--
    var now = new Date();
    var Weekday = new Array("SUN","MON","TUE","WED","THU","FRI","SAT");
    var Month = new Array("JAN","FEB","MAR","APR","MAY","JUN ","JUL","AUG","SEP","OCT","NOV","DEC");
    document.write(Weekday[now.getDay()]+", "+Month[now.getMonth()]+" "+now.getDate()+", "+now.getFullYear());
    //--></script>
    Javascript is case sensitive. This means that the variable curDate and CurDate are different variables.
    Soquili
    a.k.a. Bill Taylor
    Bill is no longer with us. He died on 10 Dec 2012. We remember him always.
    My TG Album
    Last XaReg update

  2. #12
    Join Date
    Nov 2000
    Location
    Red Boiling Springs TN USA
    Posts
    19,208

    Default Re: Day month year and Filename

    Here is a xar file with the code in a placeholder.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	javascript_date.jpg 
Views:	131 
Size:	7.5 KB 
ID:	69301  
    Attached Files Attached Files
    Soquili
    a.k.a. Bill Taylor
    Bill is no longer with us. He died on 10 Dec 2012. We remember him always.
    My TG Album
    Last XaReg update

  3. #13
    Join Date
    May 2009
    Location
    Germany
    Posts
    145

    Default Re: Day month year and Filename

    Hi,
    try this:

    <script type="text/javascript"><!--
    var curDate = new Date();
    var CurYear = curDate.getFullYear();
    CurYear = CurYear.toString().slice(2);
    var Weekday = new Array("SUN","MON","TUE","WED","THU","FRI","SAT");
    var Month = new Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","A UG","SEP","OCT","NOV","DEC");
    document.write(curDate.getDate()+ " " +Month[curDate.getMonth()]+ " " + CurYear);
    //--></script>

  4. #14
    Join Date
    Aug 2000
    Location
    Beaverton, OR
    Posts
    3,267

    Default Re: Day month year and Filename

    Thanks, Bill and Sebastion.

    Sebastion, you nailed it.

    It looks like there can be a variety of ways of setting variables and formatting syntax in Javascript. I don't know any programming (just a tiny bit), so I was looking at Steve's posting trying to identify repeatable patterns of syntax and then pluging in additional lines of code.

    I compiled previous code postings into the attached file in case someone else would like to use it.

    If there are errors in it or "nonstandard" formating used, let me know.

    John C.
    Attached Files Attached Files

 

 

Tags for this Thread

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
  •