6.0.0-RC7
6/30/26

[#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 4/6/06 (7390 days ago)
Due
Updated 6/14/07 (6956 days ago)
Assigned 11/5/06 (7177 days ago)
Resolved 6/14/07 (6956 days ago)
Github Issue Link
Github Pull Request
Milestone 2.2
Patch No

History
233 Chuck Hagenbuch Comment #15
State ⇒ Resolved
Reply to this comment
Okay, fallback added as Horde_Date::_mktime, used in Horde_Date::timestamp
42 Jan Schneider State ⇒ Assigned
 
499 Chuck Hagenbuch Taken from Chuck Hagenbuch
State ⇒
 
79 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.
24 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.
404 Jan Schneider Comment #12 Reply to this comment
...with PHP 4 actually.
84 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.
403 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.
137 Jan Schneider Comment #9 Reply to this comment
PHP 5.1 makes this just work.
Even on Windows?
204 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?
378 Chuck Hagenbuch Assigned to Chuck Hagenbuch
 
433 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.
263 Chuck Hagenbuch Comment #6 Reply to this comment
Any further testing results?
4110 Jan Schneider State ⇒ Feedback
 
99 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
4612 Jan Schneider Comment #4
Priority ⇒ 3. High
Reply to this comment
That's indeed a nice solution, independently from this specific bug.
5811 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




349 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,

);


4210 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