FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > General Coding/Development
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 04-25-2000, 11:40 AM   Postid: 19987
token
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Apr 2000
Location: sydney australia
Posts: 22
need to tweak the time on guestbook

hi all!

i have just made a site but it is for people in taiwan,
i need to know if i can find a script that i am able to tweak the time to the taiwanese local time, which is 12 hours ahead of US eastern time....
any idea???

thanks

token is offline   Reply With Quote
Old 04-25-2000, 04:30 PM   Postid: 19988
mike_w
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1999
Location: Brooklyn, NY
Posts: 132
There is an environmental variable that you can set - TZ - timezone. Definitions for the various timezones are located in /usr/share/zoneinfo - just browse this directory to find the correct name to set TZ to, it will be the file's name. If the correct file is in a directory under /usr/share/zoneinfo, then use this format - directory/filename, see the test script below for clarification.

Try this as a test and see if it reports the correct time for Taiwan -


Code Sample:


#!/usr/bin/perl

$ENV{TZ} = 'Asia/Taipei';

print scalar localtime, "\n";
print scalar gmtime, "\n";





Just set TZ in your script and it should work.


[This message has been edited by mike_w (edited 04-25-00@4:43 pm)]
mike_w is offline   Reply With Quote
Old 04-26-2000, 12:08 AM   Postid: 19989
token
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Apr 2000
Location: sydney australia
Posts: 22
sorry but...i am not a perl programmer, could you please tell me where i can paste the file?

here is what i got for the date line...

# Get the Date for Entry
$date = `$date_command +"%A, %B %d, %Y at %T (%Z)"`; chop($date);
$shortdate = `$date_command +"%D %T %Z"`; chop($shortdate);

should i then replace the codes??

thanks i advance!
token is offline   Reply With Quote
Old 04-26-2000, 11:47 AM   Postid: 19990
mike_w
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1999
Location: Brooklyn, NY
Posts: 132

That snippet of code doesn't help me much. But, it looks like that script is using /bin/date as the date command. Is there a line that reads -

$date_command = "/bin/date";

If so, then you can probably add this just before that line -

$ENV{TZ} = 'Asia/Taipei';

Which guestbook are you using? If you have a link to where I can get the source code I could look at it, wouldn't take me more than 10 or 15 minutes.

mike_w is offline   Reply With Quote
Old 04-26-2000, 02:12 PM   Postid: 19991
token
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Apr 2000
Location: sydney australia
Posts: 22
Hey thanks Mark!!

it is finally working.. but i am thinking using another powerful script....(call me greedy ) but imight have to come back and hassel u again if u got time

and...another thing is.... need a counter....like i want a real counter that can actually count howm any ppl have been visiting and all dat....got any idea?

thanks!!

token is offline   Reply With Quote
Old 04-26-2000, 02:12 PM   Postid: 19992
token
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Apr 2000
Location: sydney australia
Posts: 22
Hey thanks Mike!!

it is finally working.. but i am thinking using another powerful script....(call me greedy ) but imight have to come back and hassel u again if u got time

and...another thing is.... need a counter....like i want a real counter that can actually count howm any ppl have been visiting and all dat....got any idea?

thanks!!

token is offline   Reply With Quote
Old 04-26-2000, 02:13 PM   Postid: 19993
token
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Apr 2000
Location: sydney australia
Posts: 22
sorry i dunno was i was typing...plz forgive me if i got ur name wrong at the frist place......grin...

it is 4 am here in sydney and i still got lots to do...

token is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 08:24 AM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.