/    Sign up×
Community /Pin to ProfileBookmark

I’m teh n00b of Server_Sides, need help with clock

[FONT=Times New Roman][SIZE=3][COLOR=Navy][B]
Okay, I don’t know the first thing about PHP (or any server-side for that matter…) I was wondering if anyone can help me put a small text clock that shows the current time in california (pacific time zone) no matter where the client is? Thanks a Bunch if you can ?
[/B]
[/COLOR]
[/SIZE]
[/FONT]

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@CytaelJun 18.2006 — might try playing around with this:

http://us3.php.net/manual/en/function.date-default-timezone-set.php

untested:
[code=php]
<?php

date_default_timezone_set("US/Pacific");
echo "Current Pacific Time: " . Date("h:i a");

?>
[/code]
Copy linkTweet thisAlerts:
@TehShlockerauthorJun 18.2006 — Um... like I said in the title, I'm a n00b when it comes to this stuff...

Where exactly do I put that code?
Copy linkTweet thisAlerts:
@CytaelJun 18.2006 — wherever you want it to appear. Needs to be in a .php file, and server needs to support php, of course.
Copy linkTweet thisAlerts:
@TehShlockerauthorJun 18.2006 — grr....
Copy linkTweet thisAlerts:
@TehShlockerauthorJun 18.2006 — Ok, so I'm a cheap bastard, and I'm using Freewebs.com.... I don't think they support php (since the only options under make a page are '.htm' and '.html') Know of any free hosters that allow php? if you don't, do you think you could help me in javascript?
Copy linkTweet thisAlerts:
@CytaelJun 18.2006 — I don't know of any free hosts that support php, and I'm nowhere near good enough with JS to help you over there, though there are probably many lurking about these boards who have the requisite skills. ?
Copy linkTweet thisAlerts:
@TehShlockerauthorJun 18.2006 — [FONT=Times New Roman][SIZE=3][COLOR=SkyBlue][B]

Yeah, but they're all n00bs!!! *slams fist on table* and won't help me... . . ?

[/COLOR]
[/SIZE]
[/FONT][/B]
Copy linkTweet thisAlerts:
@NogDogJun 18.2006 — First free PHP host I found via Google: http://www.agigforfree.com/

Here's an article on doing it via JavaScript: http://javascript.about.com/library/bltime1.htm
Copy linkTweet thisAlerts:
@SheldonJun 18.2006 — javascript will give you an active clock, where PHP will only update your clock when the pages is refreashed
×

Success!

Help @TehShlocker 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.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...