🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #28492

Re: Różnica podczas dekodowania daty z php

#28492
From: Roman Dobosz
Date: Thu, 28 Nov 2013 18:40
30 lines
2491 bytes
On Fri, 22 Nov 2013 03:18:01 -0800 (PST)
ammate@gmail.com wrote:

> > %m to miesiąc, %M to minuty.
> 
> Drobne przeoczenie ale dalej jest różnica:
> datetime.fromtimestamp(1355295480).strftime('%Y-%m-%d %H:%M:%S')
> '2012-12-12 07:58:00'

Tak. Stachu wskazał paluchem gdzie jest błąd:

$ php -a
Interactive shell

php > echo "\n".date('Y-m-d H:i:s', 1355295480) . "\n";
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in php shell code on line 1

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in php shell code on line 1

2012-12-12 06:58:00
php > date_default_timezone_set('CET');
php > echo "\n".date('Y-m-d H:i:s', 1355295480) . "\n";

2012-12-12 07:58:00
php >

-- 
      -^-  _        coś tam w tle sobie gra, np:
   _ /O)_\//        Front Line Assembly - Barcode (Re-Assembled Mix) 
  (_(|__(_(_) grf.
Technical Details
Message-ID: <20131128194025.c8ea3a505199fb6db3b1b649@spam-o2.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!.POSTED!not-for-mail
References: <59fec2e5-b1b7-421d-907e-a885ffba7df3@googlegroups.com> <528f3afa$0$2278$65785112@news.neostrada.pl> <a134b653-e92c-4b71-acbf-72b459aa3313@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!.POSTED!not-for-mail
From: Roman Dobosz <gryf_esm-no@spam-o2.pl>
Newsgroups: pl.comp.lang.python
Subject: Re: Różnica podczas dekodowania daty z php
Date: Thu, 28 Nov 2013 19:40:25 +0100
Organization: ICM, Uniwersytet Warszawski
Lines: 30
Message-ID: <20131128194025.c8ea3a505199fb6db3b1b649@spam-o2.pl>
References: <59fec2e5-b1b7-421d-907e-a885ffba7df3@googlegroups.com> <528f3afa$0$2278$65785112@news.neostrada.pl> <a134b653-e92c-4b71-acbf-72b459aa3313@googlegroups.com>
NNTP-Posting-Host: bwx201.neoplus.adsl.tpnet.pl
Mime-Version: 1.0
X-Trace: news.icm.edu.pl 1385664027 18630 83.29.247.201 (28 Nov 2013 18:40:27 GMT)
X-Complaints-To: usenet@news.icm.edu.pl
NNTP-Posting-Date: Thu, 28 Nov 2013 18:40:27 +0000 (UTC)
X-Newsreader: Sylpheed 3.3.0 (GTK+ 2.24.17; x86_64-pc-linux-gnu)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit