Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Page 1 of 4 1234 LastLast
Results 1 to 15 of 55

This is a discussion on Managing time difference in the Shared & Semi-Dedicated forum
Hi. I am from Japan and now trying to fix the time difference problem. I just customized a form cgi some by myself and still ...

  1. #1
    JPC Senior Member
    Join Date
    Jun 2004
    Location
    Hakuba Nagano Japan
    Posts
    52

    Angry Managing time difference

    Hi.

    I am from Japan and now trying to fix the time difference problem.
    I just customized a form cgi some by myself and still need to do something else.
    Time difference part is one of what i have to solve.
    When someone request something by the forms, I am to get an e-mail and it tells me what time they submitted the form.

    But the time described there is the CST time where the hosting server is located. I would like to change it into Japan time and asked the form cgi developer. They told the way and i did it but it doesn't work

    Has anyone had the same problem before and if you did and solved the problem, could you help me out from a deep pond of confusion ??? lol.....

    Another problem is I need much more time to understand 'cause of language Please have patience when I say something weird
    . I always try to be polite but guess probably a lot often i use wrong words!!!!

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Gamera,

    Could you post a few lines of the script where you are trying to make the time conversion? That way we can see how it works and make a suggestion. There are different ways of getting the current time in your code, so knowing how you are doing it will help us to make the best possible solution to what you are doing.

    Don't worry about your language difficulties. Your posts are very understandable. Welcome to JPC.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    JPC Senior Member
    Join Date
    Jun 2004
    Location
    Hakuba Nagano Japan
    Posts
    52
    Hi Jason

    Here's the script.

    # 時差調整 海外サーバー利用時など時刻がずれるようなら調整して下 さい 時間単位です
    $time_dif = -9;

    Probably you can't see the Japanese description correct while you are on a computer with an English OS though.
    The Japanese description which probably looks like a queue of icons says like .....

    #Fixing time difference. When you use a server abroad, you can fix it replacing the time.

    They say the "-9" is for Japan.
    So i tried a lot ways replacing the -9 into others like 0,1,+1,2,+2,6,+6,-18.. etc etc but none works
    Last edited by gamerajp; 06-09-2004 at 09:52 AM.
    Cozy home in country.
    http://www.hakubajapan.com

  4. #4
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    OK, that doesn't help me much. I'd ask you to send me the whole script, but if it is all in Japanese then I won't be able to do much with it.

    According to timeanddate.com, Tokyo is offset from GMT by +9 hours. JPC servers aren't set to GMT, though, they are set to US Central Time, which is at an offset of -5 hours from GMT right now. So the value you probably want to try is +14, because you have to add 5 hours to get to GMT and then +9 to get to Japan time.

    Also note that the US observes Daylight Savings time, which causes a change in the GMT offset of your server twice a year. For example, starting at 2:00 AM on October 31 the offset will become -6 for about 6 months.

    Confused yet?

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  5. #5
    JPC Senior Member
    Join Date
    Jun 2004
    Location
    Hakuba Nagano Japan
    Posts
    52
    No, I don't get confused. Exactly I am 14 hours forward from the CST at the moment.
    Just tried +14 and 14, but don't work.

    No Jason, I don't think it's easy for you to read/understand Japanese as far as you don't know it. It's like someone asks me
    to understand Greek or Arabic!!!
    Thanks for your help, i appreciate.
    Cozy home in country.
    http://www.hakubajapan.com

  6. #6
    Insanity Incarnate Piyer's Avatar
    Join Date
    Jan 2003
    Location
    Brooklyn, NY
    Posts
    61
    I won't pretend to be anything but a newbie with this kind of program, but... 1) shouldn't the number be enclosed in ' ' when it includes a + or - sign? 2) shouldn't there be a setting for the nature of the offset ( plus or minus)?

    If I were to try to write it, I'd probably do something like this:


    $time_dif = '14';
    $server_time = $server_time + $time_dif;

    The above would be for PHP, I'm not sure if the same exact code would work in cgi.
    AJ Kleipass
    ----------------------------------------------
    http://www.rockycrater.org

  7. #7
    JPC Senior Member
    Join Date
    Jun 2004
    Location
    Hakuba Nagano Japan
    Posts
    52
    So do you mean I just need to write

    $time_dif = 14;

    (without ' ')????
    Cozy home in country.
    http://www.hakubajapan.com

  8. #8
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Cool, a guessing game! How about:

    $time_dif = $time_dif - 9;
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL ゥ 2010

  9. #9
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    BTW, for non-Firefox users, this is what the script looks like...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL ゥ 2010

  10. #10
    JPC Senior Member
    Join Date
    Jun 2004
    Location
    Hakuba Nagano Japan
    Posts
    52
    $time_dif = $time_dif - 9;

    If we knew only mathmatics, we never agree with this but if we
    knew some computer stuff, we often see this above which i am really not good at lol....
    Cozy home in country.
    http://www.hakubajapan.com

  11. #11
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Piyer,

    When you encose a number in quotes it stops being a number. Depending on the language it may become either a sting or a character. Some languages (like PHP) can interpret numerals in non-numeric datatypes as numbers and will treat them as such, but not all languages can do this. In most cases, however, numeric data types are signed--that is they can have positive or negative values. So -14 is a prefectly valid number, as is +14 (althougth positive is assumed when no sign is given).

    Gamerajp,

    In the equation you posted, $time_dif = $time_dif - 9;, the = sign doesn't really mean "equals." The = is the assignment operator. What that line is saying is $time_df becomes the current value of $time_df minus nine--not $time_df is the same as $time_df minus nine. That's the fundamental difference between programming and straight math.

    As for the problem, what is actually hpeening? Is the server time still being reported or is some totally different value (or nothing at all) coming through? Or are you getting an error? Or nothing at all? It is hard to make more suggestions without knowing what is actually happening.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  12. #12
    Insanity Incarnate Piyer's Avatar
    Join Date
    Jan 2003
    Location
    Brooklyn, NY
    Posts
    61

    Thanks Jason for spelling that out. I probably should have known that from when I was learning Perl. PHP has spoiled me.
    AJ Kleipass
    ----------------------------------------------
    http://www.rockycrater.org

  13. #13
    Ron
    Guest
    I have held my fingertips on this so far, as I don't know what time function he is using. He may be trying to adjust a time difference by 9 clock ticks, or 9 seconds, or 9 days or....(?) instead of the desired 9 hours.

    Wouldn't knowing the time functions in use be helpful before guessing at the syntax of the math?

  14. #14
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Ron,

    Yes, that's what I've been trying to get at. Not seeing the code is the problem I've pointed out. I suspect, if the developers of the script said to use a single digit integer, that the value refers to hours, but it wouldn't be the first time I saw a developer make a mistake, either.

    I thought about posting things to look for, but its been a long time since I've done any perl programming (assuming that's what he's using), so I figured before I did that I'd go dig out my perl books and and brush up on the various time functions.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  15. #15
    Ron
    Guest
    Agreed! Maybe asking to see several places where in the code $time_dif was referenced might work... or maybe even a few lines around each reference.

Page 1 of 4 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •