FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Date and Time





Dennise
Can someone please suggest a simple way to put Date and Time on a web page?

Thanks. Rolling Eyes
LukeakaDanish
Using javascript should be the easiest way.

http://www.javascriptmall.com/jsc/jsC4Udate.htm

Try that link maybe.
Dennise
Thanks, I'll have a look Smile
milk
If not Javascript, PHP with the date(); function can be used as a string.

echo date('l jS \of F Y');
Dennise
I'm trying the script below to display current day and date. But Internet Explorer displays this message when accessing the page:"To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Click here for options ....." After I tell IE to proceed anyway, the day and date appear just fine.

This does not happen with FireFox.

How can I get around this IE message? Does IE throw up this message anytime it see JavaScript? There has to be a way around this.

My script:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT Language="JavaScript">
<!-- hide from old browsers
function GetDay(intDay){
var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday")
return DayArray[intDay]
}

function GetMonth(intMonth){
var MonthArray = new Array("January", "February", "March",
"April", "May", "June",
"July", "August", "September",
"October", "November", "December")
return MonthArray[intMonth]
}
function getDateStrWithDOW(){
var today = new Date()
var year = today.getYear()
if(year<1000) year+=1900
var todayStr = GetDay(today.getDay()) + ", "
todayStr += GetMonth(today.getMonth()) + " " + today.getDate()
todayStr += ", " + year
return todayStr
}

//-->
</SCRIPT>
</head>
<body bgcolor="#FFFFFF">
<SCRIPT Language="JavaScript">
<!-- hide from old browsers
document.write(getDateStrWithDOW())
//-->
</SCRIPT>
</body>
</html>

Dennise
This problem (a MS XP service Pak 2 security fix really) only appears when viewing pages locally .... not via the internet. It's only a nuisance when designing and testing new pages locally with Internet Explorer.

You can add a bit of special code called "Mark of the Web" to your code to eliminate the 'problem' but it may not be worth it. Wink
Related topics
10 Reasons to Date a Hockey Player
FTP - file last modified date
keep your adblocking up to date
When dating a new girl, how long do you wait before you kiss
PHP date() format for atom in php 4
A ActionScript,showing a running date.
Quels sous-forums aimeriez-vous avoir??
Date wrong on pc
Guess the Windows Vista Launch Date(Win Prizes!!!!)
Ten reasons you should date a geek
Is there a release date for ET:QW
mySQL - Day, date, month, year, time Output/Input
What date format do you prefere with MySQL?
date() function
What shouldn't you do/where shouldn't you take a first date?
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.