<div dir="ltr"><div><div><div><div>let's continue on koha-devel<br><br>Hum, Koha::DateUtils looks buggy too:<br><br></div>use Modern::Perl;<br>use Koha::DateUtils qw( dt_from_string output_pref );<br>use DateTime;<br>use DateTime::Format::DateParse;<br><br>my $date_string = '15/06/1800'; # metric in pref<br><br>my $dt = dt_from_string( $date_string );<br>say '1 => ' . output_pref( $dt ) if $dt;<br><br>$dt = DateTime->new(year => 1800, month => 06, day => 15);<br>say '2 => ' . output_pref( $dt ) if $dt;<br><br>$date_string = '06/15/1900';<br>$dt = DateTime::Format::DateParse->parse_datetime( $date_string );<br>say '3 => ' . output_pref( $dt ) if $dt;<br><br>$dt = DateTime::Format::DateParse->parse_datetime( $date_string, 'Europe/Paris' );<br>say '4 => ' . output_pref( $dt ) if $dt;<br><br></div>Will display:<br>   2 => 15/06/1800 00:00<br><br></div>The problem comes from DateTime::Format::DateParse.<br></div>Somebody knows why we use this module instead of generating a DateTime object directly from the DateTime module?<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-20 11:18 GMT+01:00 Jonathan Druart <span dir="ltr"><<a href="mailto:jonathan.druart@biblibre.com" target="_blank">jonathan.druart@biblibre.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="im HOEnZb">Hello Hugo,<br>
<br>
You should try to use Koha::DateUtils, instead of C4::Dates.<br>
I found some occurrences of "1900" in C4::Dates, maybe there are some<br>
stuffs hardcoded in it.<br>
We are going to deprecate C4::Dates.<br>
<br>
Cheers,<br>
Jonathan<br>
<br>
2015-01-20 10:26 GMT+01:00 Hugo Agud <<a href="mailto:hagud@orex.es">hagud@orex.es</a>>:<br>
</span><div class="HOEnZb"><div class="h5">> Dear all,<br>
><br>
> We're experiencing problems filling dates before 1900 in Serial startdate,<br>
> for dats after 1900 it stores fine the date, but for dates before 1900, it<br>
> stores fine in mysql but in intranet shows the date you filled + 1900, then<br>
> you have for example start date 3725.<br>
><br>
> We have tried to modiy Dates.pm but without success, any suggestions? we<br>
> have not been able to find any bug related<br>
><br>
> thanks you in advance!<br>
><br>
> --<br>
><br>
> *Hugo Agud - Orex Digital *<br>
><br>
> *<a href="http://www.orex.es" target="_blank">www.orex.es</a> <<a href="http://www.orex.es" target="_blank">http://www.orex.es</a>>*<br>
><br>
><br>
> Director<br>
><br>
> Passatge de la Llançadera, 3 · 08338 Premià de Dalt - Tel: 93 539 40 70<br>
> <a href="mailto:hagud@orex.es">hagud@orex.es</a> · <a href="http://www.orex.es/" target="_blank">http://www.orex.es/</a><br>
><br>
><br>
><br>
> No imprima este mensaje a no ser que sea necesario. Una tonelada de papel<br>
> implica la tala de 15 árboles y el consumo de 250.000 litros de agua.<br>
><br>
><br>
><br>
> Aviso de confidencialidad<br>
> Este mensaje contiene información que puede ser CONFIDENCIAL y/o de USO<br>
> RESTRINGIDO. Si usted no es el receptor deseado del mensaje (ni<br>
> está autorizado a recibirlo por el remitente), no está autorizado a copiar,<br>
> reenviar o divulgar el mensaje o su contenido. Si ha recibido este mensaje<br>
> por error, por favor, notifíquenoslo inmediatamente y bórrelo de su sistema.<br>
> _______________________________________________<br>
> Koha mailing list  <a href="http://koha-community.org" target="_blank">http://koha-community.org</a><br>
> <a href="mailto:Koha@lists.katipo.co.nz">Koha@lists.katipo.co.nz</a><br>
> <a href="http://lists.katipo.co.nz/mailman/listinfo/koha" target="_blank">http://lists.katipo.co.nz/mailman/listinfo/koha</a><br>
</div></div></blockquote></div><br></div>