Página 2 de 2

Re: Comparar fechas

NotaPublicado: 2013-01-21 06:20 @306
por gema258
¡Solucionado! De hecho, sí que dependía de los directorios...

Muchas gracias, ¡muy, muy buena web!

Re: Comparar fechas

NotaPublicado: 2013-01-21 15:34 @690
por explorer
¿Sólo 281 paquetes? Ese debe ser el número de paquetes que trae ActiveState por defecto.

Por favor, repasa la parte 3.3 de la guía del PPM que te enlacé, para agregar el repositorio de trouchelle.

Si a la hora de instalar el módulo, lo ha hecho en algún directorio extraño, se puede indicar dentro del programa con 'use lib ...'.

Re: Comparar fechas

NotaPublicado: 2013-05-20 10:10 @465
por ealfaro
Hola a todos.

Estoy intentado utilizar el módulo DateTime::Format::Strptime como usáis aquí.

Funciona correctamente mi script, pero al lanzarlo muestra una serie de mensajes en la consola diciendo que el módulo DateTime::Locale::Base está obsoleto.

¿Qué es lo que ocurre? Estos son los mensajes:
The am_pms method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 610
The default_date_format method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 613
The default_time_format method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 617
The default_datetime_format method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 621
The day_names method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 671
The day_abbreviations method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 671
The month_names method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 682
The month_abbreviations method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 682
The am_pms method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 469
The am_pms method in DateTime::Locale::Base has been deprecated. Please see the DateTime::Locale distribution's Changes file for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 469

Re: Comparar fechas

NotaPublicado: 2013-06-19 12:37 @567
por explorer
Bienvenido a los foros de Perl en Español, ealfaro.

Pues lo que me parece que tienes una familia de módulos DateTime muy viejita... El archivo de cambios dice que esos métodos que está intentando usar StrpTime, desaparecieron en el 2009...

Prueba a actualizarlos...

Re: Comparar fechas

NotaPublicado: 2016-03-28 13:13 @592
por coltx
explorer, sobre este mismo ejemplo, ¿se podría utilizar para realizar la comparación de dos fechas pero con hora incluida? Por ejemplo:

Fecha 1 : 2016-03-28 10:01:10
Fecha 2 : 2016-04-10 23:13:02

Re: Comparar fechas

NotaPublicado: 2016-03-28 16:06 @712
por coltx
Ya lo encontré, me respondo solo... ¡jajajaja!
Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1.         my $Strp = new DateTime::Format::Strptime(pattern=>'%Y-%m-%d %H:%M:%S');
  2.  
  3.         my $dt_fecha1 = $Strp->parse_datetime( $Fecha1 );
  4.         my $dt_fecha2 = $Strp->parse_datetime( $Fecha2 );
  5.  
  6.         my $cmp = DateTime->compare($dt_fecha1, $dt_fecha2);
Coloreado en 0.002 segundos, usando GeSHi 1.0.8.4