Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > BlueVoda Website Builder Forums > BlueVoda Tips, Tricks and Shortcuts

Notices

BlueVoda Tips, Tricks and Shortcuts Know a great BlueVoda (or Web design) tip or trick? Share it with the world here. Become famous for your brilliance! Please, No Questions or Problems!

Reply
 
LinkBack Thread Tools
  #1  
Old 02-03-2008, 09:09 AM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 8,823
Default Date script - Displaying the date on your website

Hi, if you need to display the data in your pages in a customizable format, you can use the following script, which displays the date in a rectangle (it is a form field actually, looks like a rectangle):


<form name=myForm>
<input type=text style="position:absolute;width:250px;border:1px #000080 solid;background-color:#E1F1FF;color:#000080;font-family:Arial;font-style:italic;font-size:14 "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","Thurs day" ,"Friday","Saturday"];
zmon=new Array();
zmon=["January","February","March","April","May","Ju ne", "July","August","September","October","Novembe r"," December"];
document.myForm.clock.value=""+zday[day]+", "+zmon[mon]+" "+date+", "+year+" "+hr+":"+min+":"+sec+ap+"";}
runClock();
//--></script>


Drag a html box in your page. Pste the code in it. You are done!

You can customize the script as for width of the box, border thickness, border color, background color, font size, type and color. Simply change the values of the parts in RED.
Those who are a bit more expert, can also change the format of the date. If, in example you only want to dispaly the date in a "25-2-08" format (for February 25, 2008 you need to customize it to be :

<form name=myForm>
<input type=text style="position:absolute;width:60px;border:1px #000080 solid;background-color:#E1F1FF;color:#000080;font-family:Arial;font-style:italic;font-size:14 "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(3,5 );}
else{year=(""+(year+10000)).substring(3,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","Thurs day" ,"Friday","Saturday"];
zmon=mon+1;
document.myForm.clock.value=""+zmon+"-"+date+"-"+year+"";}
runClock();
//--></script>


To place the script in your pages, simply add a HTML box in your page, and paste the script in it.
__________________
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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 06-27-2008, 08:42 PM
Corporal
 
Join Date: Mar 2008
Posts: 18
Default Re: Date script - Displaying the date on your website

Hello Navaldesign, I am using the ABVFP and create the form from the example that it was giving, MY QUESTION is how can I display the data that I enter from the form. Can you or someone out there help me. Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 11:07 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2007 VodaHost.com - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53