We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4673
    • 577 Posts
    Is there anyway to convert something like ::
     set customers_info_date_account_last_modified = now() where customers

    to something a bit more server/worldly friendly?

    I’m working on some code but I can’t for the life of me figure out how I can fiddle with the code so that I could do something like:

    $my_now = now() + 9 hours;

     set customers_info_date_account_last_modified = ' . $my_now . ' where customers


    At the moment I’m working on a private project but what gets solved here will definitely show up later !
    I promise .... scouts honor .... hehe, a teaser line.
      Tangent-Warrior smiley
      • 18397
      • 3,250 Posts
      Piece of cake! (Chocolate please wink )

      http://us3.php.net/strtotime
        • 32241
        • 1,495 Posts
        I thought carsten want a function for MySql itself, instead of PHP, isn’t it?

        Anyway if you want MySql, here is the sql query.
        DATE_ADD(NOW(), INTERVAL 9 DAY)


        Honestly, I don’t really get the question, but I hope my suggestion and mark’s will be usefull to you.
          Wendy Novianto
          [font=Verdana]PT DJAMOER Technology Media
          [font=Verdana]Xituz Media
          • 4673
          • 577 Posts
          COOL!

          Need the code for a mysql call rather than php.

          Problem is that my server is in Vancouver and I live in Japan. +9 hours wink

          So if you just do simple mysql now() inserts you get stuck with the server setting rather than the "virtual" site setting.

          Now is this possible to set on a domain basis? like in .htaccess or something ?

          Or could I do :
          php putenv( "PHP_TZ=ASIA/TOKYO" );
          Could this overide for the domain or would it likely blow a fuse in the server?



          laugh do we have this in MODx huh
          doh, I really should check things like this more often!

          Thanks guys and gals smiley
            Tangent-Warrior smiley
            • 32241
            • 1,495 Posts
            My suggestion will be using a php to detect the ip address using free ip checking and decide the time zone, and in your php code you will need to add/subtract the current server time that you use.

            As for community base website, you can set this as a setting and all you need to do just read the setting of the time zone that your users have, which is a lot easier to implement that detecting their ip address.

            Hope it helps again...
              Wendy Novianto
              [font=Verdana]PT DJAMOER Technology Media
              [font=Verdana]Xituz Media