Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Time Zone

my site showing different time. where can i Set my time , i have to set Indian Standard time there is difference of 30 Min.
I m Using Vanilla 2.2

thankyou

Comments

  • in file bootstrap.php in your root on line 40 there is your timezone

    // Make sure a default time zone is set
    date_default_timezone_set('UTC');
    
  • I have made change in bootstrap as well as config but still there is time lag of 30 min.

  • btw Thanks for response :)

  • These timezones are supported by php: http://php.net/manual/en/timezones.indian.php

  • LincLinc Detroit Admin

    @jackmaessen said:
    in file bootstrap.php in your root on line 40 there is your timezone

    No, this is absolutely wrong.

    In your conf/config.php add this (substituting your own timezone):

    $Configuration['Garden']['GuestTimeZone'] = 'America/Detroit';

    @excuse_me Unfortunately, Vanilla does not currently support half-hour differences in timezones, only full hours.

  • So there is no way to set this time ?

  • hgtonighthgtonight ∞ · New Moderator

    @excuse_me said:
    So there is no way to set this time ?

    Linc said:
    excuse_me Unfortunately, Vanilla does not currently support half-hour differences in timezones, only full hours.

    ...

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • jackmaessenjackmaessen ✭✭✭
    edited November 2015

    This seems to work when putting in index.php:

    // set custom time
    $offset = '+5:30'; // 5 hours and 30 minutes later
    
    // Calculate seconds from offset
    list($hours, $minutes) = explode(':', $offset);
    $seconds = $hours * 60 * 60 + $minutes * 60;
    // Get timezone name from seconds
    $tz = timezone_name_from_abbr('', $seconds, 1);
    // Workaround for bug #44780
    if($tz === false) $tz = timezone_name_from_abbr('', $seconds, 0);
    // Set timezone
    date_default_timezone_set($tz);
    ini_set('date.timezone', $tz);
    
  • LincLinc Detroit Admin
    edited November 2015

    The operative word being seems. You are altering your server's timezone (and therefore how time data is stored) rather than just altering the output. You are potentially creating a world of hurt for yourself.

    ConPHPucious say:

    If a dev thinks a timezone problem is simple, the dev has not pondered it long enough.

  • I agree @Linc. Was just testing with some things...

Sign In or Register to comment.