Re: Pure Perl DateTime

2009-01-14 Thread Alex Teslik
On Wed, 14 Jan 2009 18:40:50 +, Lyle wrote
 Hi All,
   I'm new to this list so please forgive me if I'm talking about 
 anything that have been previously covered.

http://www.nntp.perl.org/group/perl.datetime/2008/11/msg7116.html



Re: DateTime::Lite

2008-11-23 Thread Alex Teslik
On Mon, 24 Nov 2008 02:36:53 +0900, Daisuke Maki wrote
 
 okay, so I'm starting to suspect that I didn't define my audience, 
 and that's causing people to go WTF, another bad clone?. Perhaps that's
 what's Jaldhar is asking elsewhere in this thread.
 

Your goals are clear. I welcome a DateTime::Lite pure Perl module that covers
the basic needs of DateTime manipulation with minimal overhead. I don't expect
full compatibility - hence the Lite.

Thanks,
Alex


Re: adding days to date

2007-11-30 Thread Alex Teslik
On Fri, 30 Nov 2007 19:36:30 +0530, jagdish eashwar wrote
 Hi,
 
 I came across some unexpected behaviour in datetime. In the following
 script, I first define $date1. Then I set $day1 = $date1. Then I add 
 2 days to $day1. Why does $date1 also get incremented?
 
 #!/usr/bin/perl
 use strict;
 use warnings;
 
 use DateTime;
 
 my $date1 = DateTime-new(year = 2007,
  month = 12,
  day = 23);
 
 my $day1 = $date1;
 
 $day1-add(days = 2);
 
 print day1 = ,$day1,\n;   # gives me 2007-12-25 correctly.
 print date1 = ,$date1,\n;  # why does $date1 also change to 2007-
 12-25?
 
 Jagdish Eashwar

date1 is never a singular value like I think you are expecting. date1 points
to a datetime object, which is a collection of multiple values and the
functions to do work on those values. When you make day1 equal to date1 you
are actually pointing day1 at the same object, and therefore the same data. So
then when you change the underlying object by doing $day1add(days=2), they
both change.

You can always dump variables to see whats inside using Data::Dumper, like this:

#!/usr/bin/perl
use strict;
use warnings;

use DateTime;
use Data::Dumper;

my $date1 = DateTime-new(year = 2007,
 month = 12,
 day = 23);

print Dumper($date1);


This question is actually more perl related than DBI related. You might want
to try asking and searching at perlmonks.com before asking here next time -
you'll probably get a faster answer.

HTH,
Alex


redistribution

2006-10-13 Thread Alex Teslik
Hello,

   Excellent project, very well done.

   I would like to redistribute D::T with something I'm building, but I have
some questions:

- CPAN says the project is Pure-Perl, which is great. I would like to throw it
in a lib in my project to save people the time of finding and installing it,
and to ensure I have control over which version is used with the software (for
updating Olsen timezone data, etc). Are there any plans to do any XS stuff, or
is it fairly reasonable to assume Pure-Perl is here to stay?

- Are there any arguments against using D::T in a CGI or mod_perl situation?
Is there any memory use info someone could point me too, or a ballpark
estimate? I found these:

http://marc.theaimsgroup.com/?l=perl-datetimem=113748815711535w=2
http://marc.theaimsgroup.com/?l=perl-datetimem=105996225616788w=2

but one is old and one veers off topic somewhat.
I need D::T specifically for timezone conversion, and really not much else.

Thanks,
Alex