6.0.0-beta1
7/5/25

[#3741] monthdayyear field for birthday before 1970-01-01
Summary monthdayyear field for birthday before 1970-01-01
Queue Turba
Queue Version 2.1
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers (at)
Requester horde (at) public (dot) linkpool (dot) de
Created 04/06/2006 (7030 days ago)
Due
Updated 06/14/2007 (6596 days ago)
Assigned 11/05/2006 (6817 days ago)
Resolved 06/14/2007 (6596 days ago)
Github Issue Link
Github Pull Request
Milestone 2.2
Patch No

History
06/14/2007 03:53:23 AM Chuck Hagenbuch Comment #15
State ⇒ Resolved
Reply to this comment
Okay, fallback added as Horde_Date::_mktime, used in Horde_Date::timestamp
11/05/2006 02:46:04 PM Jan Schneider State ⇒ Assigned
 
05/22/2006 09:56:49 PM Chuck Hagenbuch Taken from Chuck Hagenbuch
State ⇒
 
05/22/2006 09:16:07 PM Jan Schneider Comment #14 Reply to this comment
Did we have Horde_Date in Horde 3.0.0?
Yes, and we use it all around in Kronolith. That means that we can use 
it at least in Horde_Date internally in any other framework packages 
which would help the original issue of this ticket.
05/22/2006 04:32:02 PM Chuck Hagenbuch Comment #13 Reply to this comment
Sure... but how do you want to do that? Use Horde_Date everywhere? Did 
we have Horde_Date in Horde 3.0.0?



We'd have to update all of the code for dealing with timestamps to use 
a hack like adodb's functions.
05/22/2006 04:22:40 PM Jan Schneider Comment #12 Reply to this comment
...with PHP 4 actually.
05/22/2006 04:22:08 PM Jan Schneider Comment #11 Reply to this comment
Good to know. But I think it would still be nice to have support for 
these dates before Horde 4.
05/22/2006 03:50:40 PM Chuck Hagenbuch Comment #10 Reply to this comment
Yup - that's where I was testing on the plane. I didn't explicitly 
test dates after 2038, but dates around 1925 work fine.
05/22/2006 07:38:13 AM Jan Schneider Comment #9 Reply to this comment
PHP 5.1 makes this just work.
Even on Windows?
05/22/2006 04:16:20 AM Chuck Hagenbuch Comment #8
Priority ⇒ 1. Low
Reply to this comment
PHP 5.1 makes this just work. So I'm less inclined to work on 
workarounds. Any other opinions here?
05/18/2006 08:56:37 PM Chuck Hagenbuch Assigned to Chuck Hagenbuch
 
05/18/2006 03:55:43 PM horde (at) public (dot) linkpool (dot) de Comment #7 Reply to this comment
I've had this bug on two servers which are both under Debian Sarge 3.1 stable.

Nearly the same configuration and the same bug.

The "adodb_date_time_library" solultion works for both machines.
05/18/2006 03:48:26 PM Chuck Hagenbuch Comment #6 Reply to this comment
Any further testing results?
05/02/2006 10:09:41 PM Jan Schneider State ⇒ Feedback
 
05/01/2006 09:08:09 PM horde (at) public (dot) linkpool (dot) de Comment #5 Reply to this comment
Resolution could be:
http://www.php.net/mktime#38068
This does not work for every date! There are discrepancies from 1 day 
for some dates.



The "adodb_date_time_library" seems to be a better solution for 
working with dates befor 1.1.1970:



http://www.xaraya.com/documentation/phpxref/xaradodb/adodb-time.inc.php.source.txt



Still testing ... Ralph
05/01/2006 12:12:46 PM Jan Schneider Comment #4
Priority ⇒ 3. High
Reply to this comment
That's indeed a nice solution, independently from this specific bug.
05/01/2006 11:51:58 AM horde (at) public (dot) linkpool (dot) de Comment #3 Reply to this comment
I found the code that causes this problem.

It's inside

horde/lib/Horde/date.php



The

     function timestamp()

     {

         return MakeTime($this->hour, $this->min, $this->sec, 
$this->month, $this->mday, $this->year);

     }



Returns a wrong value for dates before 1970-01-01



System

Debian Sarge 3.1 with PHP Version 4.3.10-16



Resolution could be:

http://www.php.net/mktime#38068



For me, this works.



Ralph




04/08/2006 09:40:34 AM Jan Schneider Comment #2
Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
Reply to this comment
Works fine with the following setting for the sql driver, it has to be 
an issue with the ldap driver:



$attributes['birthday'] = array(

     'label' => _("Birthday"),

     'type' => 'monthdayyear',

     'params' => array(1900, null, true, '%Y-%m-%d'),

     'required' => false,

);


04/06/2006 10:05:42 AM horde (at) public (dot) linkpool (dot) de Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Queue ⇒ Turba
Type ⇒ Bug
Summary ⇒ monthdayyear field for birthday before 1970-01-01
Reply to this comment
Maybe after installing the latest Horde & Turba updates, the birthday

field can't save dates before 1970-01-01.



This worked before...



I included mozillaAbObsoletePerson as schema for my OpenLDAP server and

added in config/sources.php

'birthday' => 'mozillaCustom2'



The LDAP browser shows for a date after 1970-01-01



# slapcat | grep custom2



1978-05-26

=> mozillaCustom2: 1978-05-26 00:00:00



That's fine.



But a date before 1970-01-01 doesn't work:



1938-05-26

=> mozillaCustom2: 1969-12-31 00:00:00



Any idea?



I've tried:



$attributes['birthday'] = array(

     'label' => _("Birthday"),

     'type' => 'monthdayyear',

     'required' => false,

     'params' => array(1900),

     'required' => false

);



and



$attributes['birthday'] = array(

     'label' => _("Birthday"),

     'type' => 'monthdayyear',

     'required' => false,

     'params' => array(1900, null, true, '%Y-%m-%d'),

     'required' => false

);



and



$attributes['birthday'] = array(

     'label' => _("Birthday"),

     'type' => 'monthdayyear',

     'required' => false,

     'params' => array(1900, null, true, '%Y-%m-%d 00:00:00'),

     'required' => false

);



The result is allways the same

Saved Queries