/    Sign up×
Community /Pin to ProfileBookmark

how could i do this?

hi all,

could some one provide a code to do thes?:

i would like a code that writes the time and date onto the page on load. could this be done? and, if so how?

if anyone could provide a code i would be most greatfull.? ?

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@pyroAug 11.2003 — <script type="text/javascript">
document.write (new Date());
</script>
Copy linkTweet thisAlerts:
@sciguyryanauthorAug 11.2003 — hi,


thanx pyro that was exactly what i needed dut, when it is displayed it has this:

Mon Aug 11 14:31:19 [COLOR=red]UTC+0100[/COLOR] 2003 WHAT IS THE red bit for and what does it mean?
Copy linkTweet thisAlerts:
@CharlesAug 11.2003 — [font=georgia]That means that the time is offset one hour from Universal Time. UTC is sort of like GMT except that leap seconds are ignored.

If you don't like that format you can use [font=monospace]new Date().toLocaleString()[/font] to have the date and time formatted according to the user's preference or we can write a routine that will format it any way that you the web author would prefer.[/font]
Copy linkTweet thisAlerts:
@sciguyryanauthorAug 11.2003 — hi,


thanks Charles.
Copy linkTweet thisAlerts:
@nkaisareAug 11.2003 — So, the visitors to your site are so dumb that they can't figure out what the current time is unless they visit your site?
Copy linkTweet thisAlerts:
@sciguyryanauthorAug 11.2003 — hi,





no, it's the idea. i like people to know the time etc wile on my site thats all.
Copy linkTweet thisAlerts:
@pyroAug 11.2003 — On my computer, I can look down to the lower-right hand side and get the current time (not even just the time I started viewing your page -- what if I'm on the page for 10 minutes?)
Copy linkTweet thisAlerts:
@sciguyryanauthorAug 11.2003 — hi,

i ee your point but, still i lke the time there it filles the blankpart of my page!
×

Success!

Help @sciguyryan 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.23,
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,
)...