/    Sign up×
Community /Pin to ProfileBookmark

Someone please help me with this clock

In the script below, after “2004” (try it to see what i mean), there is a comma… How do i remove this comma?

THANKS SOOO much!!! ?

<html>
<head>
<title>Example</title>
</head>
<body>
<div id=’Clock’ class=”text”>&nbsp;</div>
<script type=”text/javascript”>
<!–
var DayNam = new Array(
“Sun”,
“Mon”,
“Tues”,
“Wed”,
“Thurs”,
“Fri”,
“Sat”);

var MnthNam = new Array(
“January”,
“February”,
“March”,
“April”,
“May”,
“June”,
“July”,
“August”,
“September”,
“October”,
“November”,
“December”);

function tick() {
var hours, minutes, seconds, ap;
var intHours, intMinutes, intSeconds; var today;
today = new Date();
intDay = today.getDay();
intDate = today.getDate();
intMonth = today.getMonth();
intYear = today.getYear();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
timeString = DayNam[intDay]+” “+intDate;
if (intDate == 1 || intDate == 21 || intDate == 31) {
timeString= timeString + “st “;
} else if (intDate == 2 || intDate == 22) {
timeString= timeString + “nd “;
} else if (intDate == 3 || intDate == 23) {
timeString= timeString + “rd “;
} else {
timeString = timeString + “th “;
}
if (intYear < 2000){
intYear += 1900;
}
timeString = timeString+” of “+MnthNam[intMonth]+” “+intYear;
if (intHours == 0) {
hours = “12:”;
ap = “am”;
} else if (intHours < 12) {
hours = intHours+”:”;
ap = “am”;
} else if (intHours == 12) {
hours = “12:”;
ap = “pm”;
} else {
intHours = intHours – 12
hours = intHours + “:”;
ap = “pm”;
}
if (intMinutes < 10) {
minutes = “0”+intMinutes;
} else {
minutes = intMinutes;
}
if (intSeconds < 10) {
seconds = “:0″+intSeconds;
} else {
seconds = “:”+intSeconds;
}
timeString = (document.all)? timeString+”, “+hours+minutes+seconds+” “+ap:timeString+” “+hours+minutes+” “+ap;
var clock = (document.all) ? document.all(“Clock”) : document.getElementById(“Clock”);
clock.innerHTML = timeString;
(document.all)?window.setTimeout(“tick();”, 1000):window.setTimeout(“tick();”, 6000);
}

tick();

//–>
</script>
</body>
</html>

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@NedalsMar 04.2004 — See that ", " after timeString, Just delete it.

timeString = (document.all)? timeString+", "+hours+minutes+seconds+" "+ap:timeString+" "+hours+minutes+" "+ap;
Copy linkTweet thisAlerts:
@The_CheatauthorMar 04.2004 — AHA!

I looked all over for that and it was right under my nose...

thanks dude ?
Copy linkTweet thisAlerts:
@The_CheatauthorMar 04.2004 — OKay.. another question

how do i make it so that the line breaks right there where that comma i wanted to remove was? I tried replacing the comma with <br> but it didn't work....
Copy linkTweet thisAlerts:
@The_CheatauthorMar 04.2004 — anyone? ?
Copy linkTweet thisAlerts:
@NedalsMar 04.2004 — 
how do i make it so that the line breaks right there where that comma i wanted to remove was? I tried replacing the comma with <br> but it didn't work....
[/quote]


Did you include the <br> in quotes?

...+"<br>"+...
×

Success!

Help @The_Cheat spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...