The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Display current date and time on my site
arlene
post Aug 6 2007, 02:40 PM
Post #1





Group: Members
Posts: 3
Joined: 6-August 07
Member No.: 3,501



How is it done to show the current date and time on my site? thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 6 2007, 02:54 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,402
Joined: 9-August 06
Member No.: 6



You can do it with JavaScript or with a server side language. What time do you want? The user's time, the server's time, the time in some special country?




User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
arlene
post Aug 6 2007, 03:09 PM
Post #3





Group: Members
Posts: 3
Joined: 6-August 07
Member No.: 3,501



I'd like to show the date and current time in a specific country (Cyprus)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
arlene
post Aug 8 2007, 01:05 PM
Post #4





Group: Members
Posts: 3
Joined: 6-August 07
Member No.: 3,501



Sorry to nag, but could someone please tell me exactly how to do this? I'm a novice web creator, with a family member pestering me to help him do this, and have no idea where to start. Please help!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Dr Z
post Aug 8 2007, 02:17 PM
Post #5


Advanced Member
****

Group: Members
Posts: 221
Joined: 23-August 06
Member No.: 11



Not exactly what you are asking for, but a creative alternative.

You can get a "weather sticker" from weather underground. There are many choices, but at least one option will display the time & temperature for the city you choose in Cyprus.
More info:
http://www.wunderground.com/about/faq/weathersticker.asp
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 8 2007, 02:26 PM
Post #6


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,402
Joined: 9-August 06
Member No.: 6



Do you have any server side languages available to you? Is the server located in Cyprus?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Aug 8 2007, 06:39 PM
Post #7


WDG Member
********

Group: Root Admin
Posts: 8,316
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Please see the FAQ entry How do I display the current date or time in my document?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Aug 9 2007, 01:01 AM
Post #8


Jocular coder
********

Group: Members
Posts: 2,298
Joined: 31-August 06
Member No.: 43



QUOTE(Dr Z @ Aug 9 2007, 04:17 AM) *

Not exactly what you are asking for, but a creative alternative.

You can get a "weather sticker" from weather underground. There are many choices, but at least one option will display the time & temperature for the city you choose in Cyprus.


It will?

QUOTE(Dr Z @ Aug 9 2007, 04:17 AM) *


From that page:
"# I want a digital gizmo for my city, but I don't live in the US.
"We don't currently have time zone data for places outside the US, so we can' t create the image with your local time on it."

Last time I looked, Cyprus wasn't in the USA. Remember also that the USA uses its own set of archaic systems for representing stuff like this, incompatible with the single system used by practically the entire rest of the world.

OP: can you use PHP? If your server is in Cyprus, it should be very easy to show local time; if not, it may be a bit of a fiddle if summer time / DST is involved.

FWIW, in my FAQ page I want to remind customers that it may be daytime where they are and the middle of the night here, so I show our local time _and_ their local time. See this page, under "How do I contact you?"

http://imaginatorium.org/shop/faq.htm#legal

Here is the (PHP) source of that page:

<p class=q>How do I contact you?
<p class=a>Please use the contact form (link at the top of each page. You can also email me (shop at imaginatorium.org), but to avoid being classed as spam, please: put the word 'puzzle' (or 'puzzles') in the Subject line, and switch off html. In extreme circumstances (you have made an order, and are not getting responses to email): telephone +81&nbsp;283&nbsp;229194 or fax +81&nbsp;283&nbsp;229142. Please remember we are 9 hours ahead of GMT: the local time in Japan when you accessed this page was

<?
$stamp = time();
echo gmdate("Hi (g:ia), o\\n l", $stamp+9*3600);
?>.

<script language=javascript type="text/javascript">
nowlocal=new Date();
document.write ('(Your local time was: ' + nowlocal + '.)');

</script>

Note that I calculate the JST (GMT+9) time explicitly. I seem to remember that the "proper" way, with timezones didn't immediately work.

HTH
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th October 2019 - 12:06 PM