Menu

#2674 Wrong gmt -offset

Feature_request
open
5
2015-01-07
2012-04-12
No

I chose Europe/Brussels as my TimeZone. Gmt- offset still is -4.
Now it should be +2.
How can I change that? It gives troubles when synchronising with Mozilla Thunderbird.

Thanks for a quick reply.

Arne

Specifications:

PROGRAM_NAME: WebCalendar v1.2.5 (29 Feb 2012)

SERVER_SOFTWARE: Apache

Web Browser: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0

PHP Version: 5.2.17

Default Encoding:

db_type: mysql

readonly: N

single_user: N

single_user_login:

use_http_auth: N

user_inc: user.php

ADD_LINK_IN_VIEWS: N

ADMIN_OVERRIDE_UAC: Y

ALLOW_ATTACH: N

ALLOW_ATTACH_ANY: N

ALLOW_ATTACH_PART: N

ALLOW_COLOR_CUSTOMIZATION: Y

ALLOW_COMMENTS: N

ALLOW_COMMENTS_ANY: N

ALLOW_COMMENTS_PART: N

ALLOW_CONFLICTS: N

ALLOW_CONFLICT_OVERRIDE: Y

ALLOW_EXTERNAL_HEADER: N

ALLOW_EXTERNAL_USERS: N

ALLOW_HTML_DESCRIPTION: Y

ALLOW_SELF_REGISTRATION: N

ALLOW_USER_HEADER: N

ALLOW_USER_THEMES: Y

ALLOW_VIEW_OTHER: Y

APPLICATION_NAME: My Calendar

APPROVE_ASSISTANT_EVENT: Y

AUTO_REFRESH: N

AUTO_REFRESH_TIME: 0

BGCOLOR: #FFFFFF

BGIMAGE:

BGREPEAT: repeat fixed center

BOLD_DAYS_IN_YEAR: Y

CAPTIONS: #B04040

CATEGORIES_ENABLED: Y

CELLBG: #C0C0C0

CONFLICT_REPEAT_MONTHS: 6

CUSTOM_HEADER: N

CUSTOM_SCRIPT: N

CUSTOM_TRAILER: N

DATE_FORMAT: LANGUAGE_DEFINED

DATE_FORMAT_MD: __dd__ __month__

DATE_FORMAT_MY: LANGUAGE_DEFINED

DATE_FORMAT_TASK: __dd__ __mon__

DEMO_MODE: N

DISABLE_ACCESS_FIELD: N

DISABLE_CROSSDAY_EVENTS: N

DISABLE_LOCATION_FIELD: N

DISABLE_PARTICIPANTS_FIELD: N

DISABLE_POPUPS: N

DISABLE_PRIORITY_FIELD: N

DISABLE_REMINDER_FIELD: N

DISABLE_REPEATING_FIELD: N

DISABLE_URL_FIELD: Y

DISPLAY_ALL_DAYS_IN_MONTH: N

DISPLAY_CREATED_BYPROXY: Y

DISPLAY_DESC_PRINT_DAY: Y

DISPLAY_END_TIMES: N

DISPLAY_LOCATION: N

DISPLAY_LONG_DAYS: N

DISPLAY_MINUTES: N

DISPLAY_MOON_PHASES: N

DISPLAY_SM_MONTH: Y

DISPLAY_TASKS: N

DISPLAY_TASKS_IN_GRID: N

DISPLAY_UNAPPROVED: Y

DISPLAY_WEEKENDS: Y

DISPLAY_WEEKNUMBER: Y

EMAIL_ASSISTANT_EVENTS: Y

EMAIL_EVENT_ADDED: Y

EMAIL_EVENT_CREATE: N

EMAIL_EVENT_DELETED: Y

EMAIL_EVENT_REJECTED: Y

EMAIL_EVENT_UPDATED: Y

EMAIL_FALLBACK_FROM: youremailhere

EMAIL_HTML: N

EMAIL_MAILER: mail

EMAIL_REMINDER: Y

ENABLE_CAPTCHA: N

ENABLE_GRADIENTS: N

ENABLE_ICON_UPLOADS: N

ENTRY_SLOTS: 144

EXTERNAL_NOTIFICATIONS: N

EXTERNAL_REMINDERS: N

FONTS: Arial, Helvetica, sans-serif

FREEBUSY_ENABLED: N

GENERAL_USE_GMT: N

GROUPS_ENABLED: Y

H2COLOR: #000000

HASEVENTSBG: #FFFF33

IMPORT_CATEGORIES: Y

LANGUAGE: none

LIMIT_APPTS: N

LIMIT_APPTS_NUMBER: 6

LIMIT_DESCRIPTION_SIZE: N

MENU_DATE_TOP: Y

MENU_ENABLED: Y

MENU_THEME: default

MYEVENTS: #006000

NONUSER_AT_TOP: Y

NONUSER_ENABLED: Y

OTHERMONTHBG: #D0D0D0

OVERRIDE_PUBLIC: N

OVERRIDE_PUBLIC_TEXT: Not available

PARTICIPANTS_IN_POPUP: N

PLUGINS_ENABLED: N

POPUP_BG: #FFFFFF

POPUP_FG: #000000

PUBLIC_ACCESS: N

PUBLIC_ACCESS_ADD_NEEDS_APPROVAL: N

PUBLIC_ACCESS_CAN_ADD: N

PUBLIC_ACCESS_DEFAULT_SELECTED: N

PUBLIC_ACCESS_DEFAULT_VISIBLE: N

PUBLIC_ACCESS_OTHERS: Y

PUBLIC_ACCESS_VIEW_PART: N

PUBLISH_ENABLED: Y

PULLDOWN_WEEKNUMBER: N

REMEMBER_LAST_LOGIN: N

REMINDER_DEFAULT: N

REMINDER_OFFSET: 240

REMINDER_WITH_DATE: N

REMOTES_ENABLED: N

REPORTS_ENABLED: N

REQUIRE_APPROVALS: Y

RSS_ENABLED: N

SELF_REGISTRATION_BLACKLIST: N

SELF_REGISTRATION_FULL: Y

SEND_EMAIL: N

SERVER_TIMEZONE: Europe/Brussels

SERVER_URL: http://kalender.somoco.biz/webcal/

SITE_EXTRAS_IN_POPUP: N

SMTP_AUTH: N

SMTP_HOST: localhost

SMTP_PASSWORD:

SMTP_PORT: 25

SMTP_USERNAME:

STARTVIEW: month.php

SUMMARY_LENGTH: 80

TABLEBG: #000000

TEXTCOLOR: #000000

THBG: #FFFFFF

THEME: none

THFG: #000000

TIMED_EVT_LEN: D

TIMEZONE: America/New_York

TIME_FORMAT: 24

TIME_SLOTS: 24

TIME_SPACER: »

TODAYCELLBG: #FFFF33

UAC_ENABLED: Y

UPCOMING_ALLOW_OVR: N

UPCOMING_DISPLAY_CAT_ICONS: Y

UPCOMING_DISPLAY_LAYERS: N

UPCOMING_DISPLAY_LINKS: Y

UPCOMING_DISPLAY_POPUPS: Y

UPCOMING_EVENTS: N

USER_PUBLISH_ENABLED: Y

USER_PUBLISH_RW_ENABLED: Y

USER_RSS_ENABLED: N

USER_SEES_ONLY_HIS_GROUPS: Y

USER_SORT_ORDER: cal_lastname, cal_firstname

WEBCAL_PROGRAM_VERSION: v1.2.5

WEBCAL_TZ_CONVERSION: Y

WEEKENDBG: #D0D0D0

WEEKEND_START: 0

WEEKNUMBER: #FF6633

WEEK_START: 1

WORK_DAY_END_HOUR: 17

WORK_DAY_START_HOUR: 8

Discussion

  • Sylvain Bolay

    Sylvain Bolay - 2012-04-19

    Dear Arne,

    1) You have to change in table webcal_config the cal_setting TIMEZONE to cal_value Europe/Brussels.
    2) remove .dat temporary files (e.g located in /tmp)
    3) Reload your web page and everything should be ok.

    Best,
    Sylvain

     
  • Ian Dunn

    Ian Dunn - 2012-05-30

    I just ran into this same problem. Manually changing the webcal_config.TIMEZONE field fixed it, but I think this is still a bug. Why does webcal_config.TIMEZONE need to be manually changed? Is it deprecated or something? The code should handle these things, rather than silently introducing bugs that users have to manually fix.

     
  • Anonymous

    Anonymous - 2012-07-10

    There appears to be 2 entries in the database mentioning timezone. One is TIMEZONE and the other is SERVER_TIMEZONE. The System Settings in WebCalendar appear to update SERVER_TIMEZONE, but the calendar events are looking at TIMEZONE.

     

    Last edit: Anonymous 2017-03-23
  • Thomas Rix

    Thomas Rix - 2013-06-20

    This bug is caused by the lines 3811 and 3812 in 'includes/functions.php'.

    The first line checks if $GLOBALS['TIMEZONE'] is empty, but this will never eval to true since the setting TIMEZONE is set to 'America/New_York' in the database. The option in 'config.php' changes the setting SERVER_TIMEZONE, which would be used if empty($GLOBALS['TIMEZONE']) evals to true. But since this never happens, the calendar always uses the TIMEZONE setting for offset calculations, which results in wrong offsets in display and in the database (events are NOT stored in UTC time since the offset calculation is wrong, it always adds +4 to the hours instead of the correct offset, -2 in my case).

    Commenting out the line 3811 in 'includes/functions.php' will always override the TIMEZONE setting with SERVER_TIMEZONE and thus result in correct offset calculations but may cause problems in other areas of the application. I just started using WebCalendar and I'm not sure which side-effects this change could have.

     
  • Adam Bernstein

    Adam Bernstein - 2014-09-08

    Seems like there is some confusing overlap or conflict between TIMEZONE and SERVER_TIMEZONE, but there is also a more fundamental issue here: times are always shown according to one or the other of those settings AFAICT, not the user's own timezone preference.

    Using the timezone selector in Preferences does update the user's TIMEZONE entry in the webcal_user_pref table, but the server timezone is still used everywhere, whether in the offset calculation next to the selector as noted above, or on the calendar, or when viewing or editing an entry. This is a real problem for those with users located across multiple different timezones, and different from the server.

    This seems surprisingly broken at a basic level, and makes me wonder if it's something that went wrong in the upgrade process (from old 1.0.2) or if the revised timezone code is actually still that buggy. Is that part of the code under current development?

     

    Last edit: Adam Bernstein 2014-09-08
  • Adam Bernstein

    Adam Bernstein - 2014-09-17

    I've fixed timezone handling across Webcal (in the offset reading next to the selector, on calendar and event pages, and in reminders), by inserting the PHP date_default_timezone_set() function where previously there was only a set_env TZ. And I note that this is required with PHP 5.4, from their updating doc:

    "In the date and time extension, the timezone can no longer be set using the TZ environment variable. Instead you have to specify a timezone using the date.timezone php.ini option or date_default_timezone_set() function. PHP will no longer attempt to guess the timezone, and will instead fall back to "UTC" and issue a E_WARNING."

    Specifically, in functions.php, after line 4091, insert:

    date_default_timezone_set( $GLOBALS['TIMEZONE'] );

    and in tools/send_reminders.php, after line 372, insert:

    date_default_timezone_set( $user_TIMEZONE );

    (For some reason even on my PHP 5.3 it wouldn't work otherwise, which remains a little mysterious. But we certainly want to be compatible with PHP >= 5.4, so I can't imagine there's any reason not to go this way.)

     

Log in to post a comment.