problem with date function 
March 18th, 2008, 08:15 PM
| | | |
Hi everyone i have this problem, when i use date('Y-m-d H:i:s') its
returning 1 more hour than it is, i mean if now is 2008-03-18
13:16:00:00 my function returns 2008-03-18 13:17:00:00, so the
question is why?. I check this on the php.ini and i don´t found
anything related and of course my server time is ok i check it, thanks
for your help. | 
March 18th, 2008, 08:45 PM
| | | | re: problem with date function
*** Jorge Reyes escribió/wrote (Tue, 18 Mar 2008 12:14:54 -0700 (PDT)): Quote:
Hi everyone i have this problem, when i use date('Y-m-d H:i:s') its
returning 1 more hour than it is, i mean if now is 2008-03-18
13:16:00:00 my function returns 2008-03-18 13:17:00:00, so the
question is why?. I check this on the php.ini and i don´t found
anything related and of course my server time is ok i check it, thanks
for your help.
| What's your date.timezone directive like? Do you get any notice if you run
the command this way?:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
echo date('Y-m-d H:i:s');
?>
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
-- | 
March 18th, 2008, 10:45 PM
| | | | re: problem with date function
On Tue, 18 Mar 2008 20:14:54 +0100, Jorge Reyes <jorg_reyes@hotmail.com>
wrote: Quote:
Hi everyone i have this problem, when i use date('Y-m-d H:i:s') its
returning 1 more hour than it is, i mean if now is 2008-03-18
13:16:00:00 my function returns 2008-03-18 13:17:00:00, so the
question is why?. I check this on the php.ini and i don´t found
anything related and of course my server time is ok i check it, thanks
for your help.
| Y -m -d H :i :s
2008-03-18 13:17:00:00
Where does the extra ':00' come from? Is this a typing error, or is your
clock just 1 minute off?
--
Rik Wasmus | 
March 18th, 2008, 11:15 PM
| | | | re: problem with date function
On 18 mar, 13:44, "Álvaro G. Vicario"
<webmasterNOSPAMTHA...@demogracia.comwrote: Quote:
*** Jorge Reyes escribió/wrote (Tue, 18 Mar 2008 12:14:54 -0700 (PDT)):
> Quote:
Hi everyone i have this problem, when i use date('Y-m-d H:i:s') its
returning 1 more hour than it is, i mean if now is 2008-03-18
13:16:00:00 my function returns *2008-03-18 13:17:00:00, so the
question is why?. I check this on the php.ini and i don´t found
anything related and of course my server time is ok i check it, thanks
for your help.
| >
What's your date.timezone directive like? Do you get any notice if you run
the command this way?:
>
<?php
>
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
echo date('Y-m-d H:i:s');
>
?>
>
--
--http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:http://bits.demogracia.com
-- Mi web de humor en cubitos:http://www.demogracia.com
--
| the date.timezone directive is commented just as default is, now i put
your lines and nothing happens, its showing the same 1 more hour, i
had to change my sql query because i need the time so now i am using
the sysdate() of the oracle server but i still need to undertstand
what happening. Regards | 
March 18th, 2008, 11:25 PM
| | | | re: problem with date function
On 18 mar, 15:43, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote: Quote:
On Tue, 18 Mar 2008 20:14:54 +0100, Jorge Reyes <jorg_re...@hotmail.com*
wrote:
> Quote:
Hi everyone i have this problem, when i use date('Y-m-d H:i:s') its
returning 1 more hour than it is, i mean if now is 2008-03-18
13:16:00:00 my function returns *2008-03-18 13:17:00:00, so the
question is why?. I check this on the php.ini and i don´t found
anything related and of course my server time is ok i check it, thanks
for your help.
| >
Y * -m -d *H :i :s
2008-03-18 13:17:00:00
>
Where does the extra ':00' come from? Is this a typing error, or is your *
clock just 1 minute off?
--
Rik Wasmus
| yes sorry this is a typing error. this is the thing 13:16:00 sorry!
any idea? | 
March 19th, 2008, 12:05 PM
| | | | re: problem with date function
Jorge Reyes wrote: Quote:
Hi everyone i have this problem, when i use date('Y-m-d H:i:s') its
returning 1 more hour than it is
| Try: date('Y-m-d H:i:s O')
This will add the timezone to the date. Is the timezone what you'd expect?
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 1 day, 12:04.]
The Semantic Web http://tobyinkster.co.uk/blog/2008/03/09/sw/ | 
March 19th, 2008, 12:15 PM
| | | | re: problem with date function
On 18 Mar, 19:14, Jorge Reyes <jorg_re...@hotmail.comwrote: Quote:
Hi everyone i have this problem, when i use date('Y-m-d H:i:s') its
returning 1 more hour than it is, i mean if now is 2008-03-18
13:16:00:00 my function returns 2008-03-18 13:17:00:00, so the
question is why?. I check this on the php.ini and i don´t found
anything related and of course my server time is ok i check it, thanks
for your help.
| As far as I can see it is 1 minute not 1 hour out? | 
March 20th, 2008, 11:45 AM
| | | | re: problem with date function
*** Jorge Reyes escribió/wrote (Tue, 18 Mar 2008 15:14:11 -0700 (PDT)): Quote: |
the date.timezone directive is commented just as default is
| Right... Then uncomment it and give it a proper value. Mine is
"Europe/Madrid", yours will be similar. Find the list of available time
zones here: http://es2.php.net/manual/en/timezones.php
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
-- |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,720 network members.
|