Results 1 to 37 of 37

Thread: How do I add today's date to website?
      
   

  1. #1
    Join Date
    Feb 2006
    Location
    UK
    Posts
    28

    Question How do I add today's date to website?

    Hi,
    I'm not sure where to post this..eeekkk!
    But i'd like to add today's date & possibly the time to my website... does blue voda offer a programme that does this?

    Many thanks

    the ever learning pigletxx

  2. #2
    Join Date
    Jul 2005
    Location
    Concord, NC
    Posts
    2,335

    Default Re: How do I add today's date to website?

    Yes. In BlueVoda, go to Insert> Ready To Use Javascripts.

  3. #3
    Join Date
    Feb 2006
    Location
    UK
    Posts
    28

    Question Re: How do I add today's date to website?

    Hi thaks for your reply,
    Found the javascript... but now how do i input the date that automatically updates itself everyday? do i need a specific date program or something?

    a sighing pigletxx

  4. #4
    Join Date
    Jul 2005
    Location
    Concord, NC
    Posts
    2,335

    Default Re: How do I add today's date to website?

    The javascript in BV does that for you.

  5. #5
    Join Date
    Feb 2006
    Location
    UK
    Posts
    28

    Default Re: How do I add today's date to website?

    It's me again... found insert>javascript - but not - Ready to Use Javascripts. so what are they?

    Might be easier & less frustrating for you if maybe you take me through it from the beginning. so far I have my index.html page infront of me. I want it to display the date maybe the time, something that will update itself.

    A struggling to get it pigletxx X:o)

  6. #6
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    Quote Originally Posted by racefan20
    The javascript in BV does that for you.
    Hi Racefan, you have mail

    Let's give our friens a hand:

    Open a html box in your page. Double click it to edit it. In the window that opens put this code:

    <form name=myForm>
    <input type=button value="Loading..." name=clock></form>
    <SCRIPT LANGUAGE="JavaScript"><!--
    function runClock(){
    theTime = window.setTimeout("runClock()", 1000);
    d = new Date();
    day = d.getDay();
    mon = d.getMonth();
    date = d.getDate();
    year = d.getYear();
    hr = d.getHours();
    min = d.getMinutes();
    sec = d.getSeconds();
    if(year<1000){year=(""+(year+11900)).substring(1,5 );}
    else{year=(""+(year+10000)).substring(1,5);}
    if(hr==0){ap=" AM";hr=12}
    else if(hr <= 11){ap=" AM"}
    else if(hr == 12){ap=" PM";hr=12}
    else if(hr >= 13){ap=" PM";hr-=12}
    if(min <= 9){min="0"+min}
    if(sec <= 9){sec="0"+sec}
    zday=new Array();
    zday=["Sunday","Monday","Tuesday","Wednesday","Thursday" ,"Friday","Saturday"];
    zmon=new Array();
    zmon=["January","February","March","April","May","June", "July","August","September","October","November"," December"];

    document.myForm.clock.value=""+zday[day]+", "+zmon[mon]+" "+date+", "+year+" "+hr+":"+min+":"+sec+ap+"";}
    runClock();
    //--></script>



    Put the html box wherever you like in your page.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  7. #7
    Join Date
    Feb 2006
    Location
    UK
    Posts
    28

    Default Re: How do I add today's date to website?

    It worked!! Thanks everso.... easy when you know how eh? lol

    Can I just pick your brains on something else... is it possible for the date just to be in dark blue (navy) font without the 'box/button"?

    a very grateful pigletxx

  8. #8
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    Quote Originally Posted by pigletxx
    It worked!! Thanks everso.... easy when you know how eh? lol

    Can I just pick your brains on something else... is it possible for the date just to be in dark blue (navy) font without the 'box/button"?

    a very grateful pigletxx
    Sorry, this is a ready made script. There are others that give separataly the date and the time, then you can combine them. Make a search
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  9. #9
    Join Date
    Feb 2006
    Location
    UK
    Posts
    28

    Default Re: How do I add today's date to website?

    Thank for all your time & help.... it's been brill!

    bless you X:o)

    A very thankful pigletxx

  10. #10
    Join Date
    Feb 2006
    Posts
    54

    Default Re: How do I add today's date to website?

    Nice one NavalD...I just borrowed it too. Works a treat. Mind having a go at solving my other nittypicky thingy. Q. is here someplace, Published site problems...It's not the 'puzzle query, I solved that. It's FTP problem I think.

  11. #11
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    Quote Originally Posted by kenkew
    Nice one NavalD...I just borrowed it too. Works a treat. Mind having a go at solving my other nittypicky thingy. Q. is here someplace, Published site problems...It's not the 'puzzle query, I solved that. It's FTP problem I think.
    So what's your problem, if any?
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  12. #12
    Join Date
    Sep 2005
    Posts
    32

    Smile Re: How do I add today's date to website?

    This script is wonderful. I just added it to my website. Thanks for making my day unexpectedly great!

  13. #13
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    Navaledesign, or Anyone:

    How do I add 28 calendar days to today's date and display that value? Do you have a script for doing that?

    Doug

  14. #14
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    No, i don't. I beleive one can be easily made if one has a reference point (sorry, i don't know what is the date according to the 28 day calendar). Give me a reference point, and the month names and i'll see if can prepare something for you.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  15. #15
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    All I want to do is add 28 days to whatever today's date is and display it. Todays date will always change, so that value will always change also.

  16. #16
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    Can anyone still help me on my last question? I need a javascript that will add 28 days to today's date and display it.

    Doug

  17. #17
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    Please note that the 28 days calendar doen't simply add 28 days to the present date. The 28 days calendar is based on a 13 month (instead of 12) basis, which makes 28X13=364 plus one "Rest "day. And, it is counted from a reference date. So if you want to display the 28 say calendar correctly, you need to have that reference date.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  18. #18
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    I do not care about a 28 days calendar. (It was only by coincidence that I said 28, but that may change for me anyway). I may as well be trying to add 11 days, or 16 days, or 55 days for that matter. Just give me an example where ANY NUMBER of days are added to today's date and that new date is displayed.

    Doug

  19. #19
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    Ok, i'll figure out something for you. Let you know tomorrow. Must it be Javascript or can it be server side (php) ? Please note that if it is php, you need to publish your pages as php
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  20. #20
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    Just some javascript that I can set right on my page is all I need.

    Doug

  21. #21
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    Navaldesign,

    Just wondered if you might have a script for me yet. Your help is appreciated.

    Doug

  22. #22
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    Working on it. It is harder to do if you need a variable number of days, as it has to take care also of 1. Day change (F.e. if you want a 8 day difference, Monday should become Tuesday, if you need a 10 days difference, Monday should become Thirsday and so on) 2. Month change (you need to check if the month changes f.e. adding 28 days to September 4 makes it October 2, whilst adding 28 days to October 4 makes it November 3: depends on the month days, which are variable 28,29,30,31) 3. Year change (adding 15 days to 20 December 2006 makes it January 4 2007)

    I think i'll make it, just give me some time.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  23. #23
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    Here is an example of adding 5 days, but I cannot get it to work in Blue Voda:

    // Get today's date
    Calendar now = Calendar.getInstance();
    Calendar working;
    SimpleDateFormat formatter = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");

    working = (Calendar) now.clone();
    working.add(Calendar.DAY_OF_YEAR, + 5);
    prt(" In five days it will be: " + formatter.format(working.getTime()));

    prt();

    }

  24. #24
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    Here is something simple. It can work for positive differences up to 31 days, but it will not work correctly if the new date goes over 28 February and, in the same time, February has 29 days. Since this is going to happen in 2008, you have more than one year to find another solution. Copy the code and simply paste it in a html box in your page. Then place the html box anywhere you want it in your page. To edit the days period, edit the number in RED

    <form name=myForm2>
    <input type=button value="Loading..." name=clock></form>
    <SCRIPT LANGUAGE="JavaScript"><!--
    function runClock(){
    theTime = window.setTimeout("runClock()", 1000);
    d = new Date();
    mon = d.getMonth();
    date = d.getDate();
    year = d.getYear();
    hr = d.getHours();
    min = d.getMinutes();
    sec = d.getSeconds();

    diff = 25
    date2 = date;
    date+=diff;
    monthdays = new Array();
    monthdays = [31,28,31,30,31,30,31,31,30,31,30,31];
    if(date>monthdays[mon]){date-=monthdays[mon] ; mon+=1}
    if (mon>13) {mon-=12 ; year+=1}



    if(year<1000){year=(""+(year+11900)).substring(1,5 );}
    else{year=(""+(year+10000)).substring(1,5);}
    if(hr==0){ap=" AM";hr=12}
    else if(hr <= 11){ap=" AM"}
    else if(hr == 12){ap=" PM";hr=12}
    else if(hr >= 13){ap=" PM";hr-=12}
    if(min <= 9){min="0"+min}
    if(sec <= 9){sec="0"+sec}

    zmon=new Array();
    zmon=["January","February","March","April","May","Ju ne", "July","August","September","October","Novembe r"," December"];

    document.myForm2.clock.value=""+zmon[mon]+" "+date+", "+year+" "+hr+":"+min+":"+sec+ap+"";}
    runClock();
    //--></script>
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  25. #25
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    NavalDesign: THANK YOU so much! Just what I was looking for.

    Doug

  26. #26
    Join Date
    Sep 2006
    Posts
    56

    Default Script is not crossing into the new year correctly

    Hi Navaldesign,

    The script you gave me has been working fine until now. But it is not working now because it has to cross into January of next year with its date difference. The proper date is not displaying now. Could you please look at the script again and correct it so it will display the right date in January? It looks like you put code in to take care of yearly crossovers, but it is not working right.

    Doug

  27. #27
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    Can you please provide me with a link to the page with the script ?
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  28. #28
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    I temporarily removed it from the page since is was not working.

    If you would, just create a blank web page and do a create HTML box and preview it from there?

    Here is the code I have:

    <form name=myForm2>
    <input type=button value="Loading..." name=clock></form>
    <SCRIPT LANGUAGE="JavaScript"><!--
    function runClock(){
    theTime = window.setTimeout("runClock()", 1000);
    d = new Date();
    day = d.getDay();
    mon = d.getMonth();
    date = d.getDate();
    year = d.getYear();
    hr = d.getHours();
    min = d.getMinutes();
    sec = d.getSeconds();
    diff = 14
    date2 = date;
    date+=diff;
    monthdays = new Array();
    monthdays = [31,28,31,30,31,30,31,31,30,31,30,31];
    if(date>monthdays[mon]){date-=monthdays[mon] ; mon+=1}
    if (mon>13) {mon-=12 ; year+=1}
    if(year<1000){year=(""+(year+11900)).substring(1,5 );}
    else{year=(""+(year+10000)).substring(1,5);}
    if(hr==0){ap=" AM";hr=12}
    else if(hr <= 11){ap=" AM"}
    else if(hr == 12){ap=" PM";hr=12}
    else if(hr >= 13){ap=" PM";hr-=12}
    if(min <= 9){min="0"+min}
    if(sec <= 9){sec="0"+sec}
    zmon=new Array();
    zmon=["January","February","March","April","May","Ju ne", "July","August","September","October","Novembe r"," December"];
    zday=new Array();
    zday=["Sunday","Monday","Tuesday","Wednesday","Thurs day" ,"Friday","Saturday"];
    document.myForm2.clock.value="Fourteen days from now will be "+zday[day]+", "+zmon[mon]+" "+date+", "+year+"";}
    runClock();
    //--></script>

    Thanks!

    Doug

  29. #29
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    Guess no one is around to answer me on this. It should resolve itself come Jan 1. Anyone is invited to reply though, if you have nothing else to do for the next few days.

  30. #30
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    Sorry, my mistake. The Months numbering for the script starts from 0, so the correct script should be as follows:

    <form name=myForm2>
    <input type=button value="Loading..." name=clock></form>
    <SCRIPT LANGUAGE="JavaScript"><!--
    function runClock(){
    theTime = window.setTimeout("runClock()", 1000);
    d = new Date();
    day = d.getDay();
    mon = d.getMonth();
    date = d.getDate();
    year = d.getYear();
    hr = d.getHours();
    min = d.getMinutes();
    sec = d.getSeconds();
    diff = 14
    date2 = date;
    date+=diff;
    monthdays = new Array();
    monthdays = [31,28,31,30,31,30,31,31,30,31,30,31];
    mon1 = mon
    if(date>monthdays[mon1]){mon+=1}
    if(date>monthdays[mon1]){date-=monthdays[mon1]}
    if(mon>11){year+=1}
    if(mon>11){mon-=12}
    if(year<1000){year=(""+(year+11900)).substring(1,5 );}
    else{year=(""+(year+10000)).substring(1,5);}
    if(hr==0){ap=" AM";hr=12}
    else if(hr <= 11){ap=" AM"}
    else if(hr == 12){ap=" PM";hr=12}
    else if(hr >= 13){ap=" PM";hr-=12}
    if(min <= 9){min="0"+min}
    if(sec <= 9){sec="0"+sec}
    zmon=new Array();
    zmon=["January","February","March","April","May","Ju ne", "July","August","September","October","Novembe r"," December"];
    zday=new Array();
    zday=["Sunday","Monday","Tuesday","Wednesday","Thurs day" ,"Friday","Saturday"];
    document.myForm2.clock.value=" Fourteen days from now will be "+zday[day]+", "+zmon[mon]+" "+date+", "+year+"";}
    runClock();
    //--></script>
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  31. #31
    Join Date
    Sep 2006
    Posts
    56

    Default Re: How do I add today's date to website?

    Thanks, Navaldesign! How did you learn how to program Javascript, btw?

    Doug

  32. #32
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: How do I add today's date to website?

    I don't know how to program in javascript. I'm just using my php knowledge which has some similarities with Javascript.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  33. #33
    Join Date
    Apr 2007
    Posts
    121

    Talking Re: How do I add today's date to website?

    Hi Naval

    Is there a way to have the date and time as just text and in a smaller font (without the button)?

    Thanks!


    Quote Originally Posted by navaldesign
    Hi Racefan, you have mail

    Let's give our friens a hand:

    Open a html box in your page. Double click it to edit it. In the window that opens put this code:

    <form name=myForm>
    <input type=button value="Loading..." name=clock></form>
    <SCRIPT LANGUAGE="JavaScript"><!--
    function runClock(){
    theTime = window.setTimeout("runClock()", 1000);
    d = new Date();
    day = d.getDay();
    mon = d.getMonth();
    date = d.getDate();
    year = d.getYear();
    hr = d.getHours();
    min = d.getMinutes();
    sec = d.getSeconds();
    if(year<1000){year=(""+(year+11900)).substring(1,5 );}
    else{year=(""+(year+10000)).substring(1,5);}
    if(hr==0){ap=" AM";hr=12}
    else if(hr <= 11){ap=" AM"}
    else if(hr == 12){ap=" PM";hr=12}
    else if(hr >= 13){ap=" PM";hr-=12}
    if(min <= 9){min="0"+min}
    if(sec <= 9){sec="0"+sec}
    zday=new Array();
    zday=["Sunday","Monday","Tuesday","Wednesday","Thursday" ,"Friday","Saturday"];
    zmon=new Array();
    zmon=["January","February","March","April","May","June", "July","August","September","October","November"," December"];

    document.myForm.clock.value=""+zday[day]+", "+zmon[mon]+" "+date+", "+year+" "+hr+":"+min+":"+sec+ap+"";}
    runClock();
    //--></script>



    Put the html box wherever you like in your page.

  34. #34
    Join Date
    Jul 2008
    Posts
    65

    Default Re: How do I add today's date to website?

    Hey.
    How can I add just a date without the current time ?

  35. #35
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,294

    Default Re: How do I add today's date to website?

    Bluevoda tips and tricks section HERE

    and this thread is a great blast from the past.....................

  36. #36
    Join Date
    Nov 2008
    Posts
    1

    Default Re: How do I add today's date to website?

    Thank you....

  37. #37
    Join Date
    Mar 2006
    Location
    Mallorca, Spain
    Posts
    6,294

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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