6.0.0-git
2021-01-19

[#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 2006-04-06 (5402 days ago)
Due
Updated 2007-06-14 (4968 days ago)
Assigned 2006-11-05 (5189 days ago)
Resolved 2007-06-14 (4968 days ago)
Milestone 2.2
Patch No

History
2007-06-14 03:53:23 Chuck Hagenbuch Comment #15
State ⇒ Resolved
Reply to this comment
Okay, fallback added as Horde_Date::_mktime, used in Horde_Date::timestamp
2006-11-05 14:46:04 Jan Schneider State ⇒ Assigned
 
2006-05-22 21:56:49 Chuck Hagenbuch Taken from Chuck Hagenbuch
State ⇒
 
2006-05-22 21:16:07 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.
2006-05-22 16:32:02 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.
2006-05-22 16:22:40 Jan Schneider Comment #12 Reply to this comment
...with PHP 4 actually.
2006-05-22 16:22:08 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.
2006-05-22 15:50:40 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.
2006-05-22 07:38:13 Jan Schneider Comment #9 Reply to this comment
PHP 5.1 makes this just work.
Even on Windows?
2006-05-22 04:16:20 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?
2006-05-18 20:56:37 Chuck Hagenbuch Assigned to Chuck Hagenbuch
 
2006-05-18 15:55:43 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.
2006-05-18 15:48:26 Chuck Hagenbuch Comment #6 Reply to this comment
Any further testing results?
2006-05-02 22:09:41 Jan Schneider State ⇒ Feedback
 
2006-05-01 21:08:09 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
2006-05-01 12:12:46 Jan Schneider Comment #4
Priority ⇒ 3. High
Reply to this comment
That's indeed a nice solution, independently from this specific bug.
2006-05-01 11:51:58 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




2006-04-08 09:40:34 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,

);


2006-04-06 10:05:42 horde (at) public (dot) linkpool (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ monthdayyear field for birthday before 1970-01-01
Queue ⇒ Turba
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