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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Mar 28 23:01:26 2024 UTC