php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13187 Concerning jdtounix() function
Submitted: 2001-09-06 19:18 UTC Modified: 2002-05-25 06:43 UTC
From: studiobl at mageos dot com Assigned:
Status: Closed Package: Calendar related
PHP Version: 4.0.6 OS: Linux Redhat 7.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: studiobl at mageos dot com
New email:
PHP Version: OS:

 

 [2001-09-06 19:18 UTC] studiobl at mageos dot com
It's not unresolvable but it must be known :

in PHP :
jdtounix(today);
returns a number of seconds sinc an origin (here we call it A)

but in MYSQL :
UNIX_TIMESTAMP(today at 00:00:00)
returns A minus 7200 seconds

that's a difference of 2 hours !

in fact when you do jdtounix(today) it more like jdtounix(today at 02:00:00)....


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-07 03:55 UTC] hholzgra@php.net
what timezone are you in ?
 [2001-09-07 07:29 UTC] studiobl at mageos dot com
I m in FRANCE(Paris) GMT or GMT+1 I think
 [2001-09-07 07:48 UTC] derick@php.net
France is GMT+2 during summer and GMT+1 during winter

Derick
 [2001-09-07 07:55 UTC] hholzgra@php.net
so jdtounix returns localtime while
mysql unix_timestamp returns GMT
 [2001-09-07 08:00 UTC] studiobl at mageos dot com
By the way I don't know why there would be a link
between my system date and those operations ???

Friday 2001-09-07 -> jd=2462160

jdtounix(2462160)=999820800 sec

UNIX_TIMESTAMP('2001-09-07 00:00:00')=999813600 sec

but : UNIX_TIMESTAMP('2001-09-07 02:00:00')=999820800 sec

Is it clear ?

 [2001-09-07 08:02 UTC] studiobl at mageos dot com
I havn't seen the last comment I was editing, 
perhaps that's an explanation but it must be noticed
in the function help...
 [2002-05-25 06:43 UTC] derick@php.net
Updated documentation for jdtounix > closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 13:01:27 2024 UTC