• 9
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

how do you deal with timezone issues? [duplicate]

Everything in UTC, and another column for the offset.

  • 8
Reply Report
      • 1
    • Absolutely the right answer. If you don't use one specific timezone to base all your timestamps, etc, on, you're going to have a world of problems. Just use an offset lookup table with date ranges, and then link your user to that. Don't store the offset as an actual number.

These are the key points to the strategy I tend to use.

  • Every date is UTC internally to the system.
  • Users are shown dates in the their local timezone.
  • We allow users to override the timezone they are using in case they travel and they want to keep the timezone consistent.
  • Make the timezone easily visible. Either display it with the time or as part of the column header.
  • 5
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions