Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.php Subject: Re: Dealing with timestamps from different timezones - general approach for basic saving? Date: Thu, 30 Oct 2014 08:14:56 +0100 Organization: PointedEars Software (PES) Lines: 31 Message-ID: <3237691.dGveQkY2Hi@PointedEars.de> References: Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1414653297 8056 eJwNwgERwDAIA0BLsJKEyWGF+pfQ3T8WnVtBMHB+paKFmPDWt8fV1dZnMhl74XWNuewBxpMXFrQQeg== (30 Oct 2014 07:14:57 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 30 Oct 2014 07:14:57 +0000 (UTC) User-Agent: KNode/4.14.1 X-User-ID: eJwFwQkBA0EIA0BL/GnlEBb8S7iZ9NIaRGVFXt7pq0AfVNbQpDbah3VMokUwPFNPVZnfozte/GNtjGvLD2msFio= Cancel-Lock: sha1:caDEcVTDMhmfQ5nI6EbF/eI6lBE= X-NNTP-Posting-Host: eJwFwYERADAEBLCVOP7VOEXtP0ITGJUdTtCxWEM/OiVepWSOikratVrOQfaBcBg9Wxax+gEL4BC0 Xref: csiph.com comp.lang.php:14428 Jerry Stuckle wrote: > But when retrieving the blog entry, you don't know the reader's timezone > (unless they've logged in and set it in their profile). Your only real > choices here are to: > > 1. Ask for their timezone and save it in a cookie (an extra operation on > their part) Or local storage. For privacy, in a server-side session. Could be in a database. > 2. Use javascript to fetch the user's timezone and display it > accordingly (off topic in a PHP newsgroup) It would be the *system’s* timezone, which is why it is error-prone. > 3. Use a combination of #1 and #2 and set a cookie with the timezone, > but it won't work on the first page they display (because the javascript > doesn't run until after the page is displayed. You would have to use > javascript to reload the page. Not necessarily. And there is no javascript. -- PointedEars Zend Certified PHP Engineer Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.