Re: Date::manip query

2007-12-19 Thread Gunnar Hjalmarsson
pauld wrote: Gunnar Hjalmarsson wrote: pauld wrote: im using Date::Manip to convert dates and times eg 2007:08:02 12:23 to allow me to sort them, Why are you doing that? C:\home>type test.pl @dates = ( '2007:08:02 12:23', '2007:10:21 04:40', '2007:06:05 16:08', '2007:09:11 22

Re: Date::manip query

2007-12-19 Thread Tom Phoenix
On 12/19/07, pauld <[EMAIL PROTECTED]> wrote: > im sorting it on a key of the hash > my @daylistsorted = sort { $$a{'START_DS'} <=> $$b{'START_DS'} } > @daylist; > generates a > Argument "2007:09:30 13:41" isn't numeric in numeric comparison (<=>) > at ./518573 Have you tried using a string comp

Re: Date::manip query

2007-12-19 Thread pauld
im sorting it on a key of the hash my @daylistsorted = sort { $$a{'START_DS'} <=> $$b{'START_DS'} } @daylist; generates a Argument "2007:09:30 13:41" isn't numeric in numeric comparison (<=>) at ./518573 error my @daylistsorted = sort { $$a{'START'} <=> $$b{'START'} } @daylist; works -- To u

Re: Date::manip query

2007-12-18 Thread Gunnar Hjalmarsson
pauld wrote: im using Date::Manip to convert dates and times eg 2007:08:02 12:23 to allow me to sort them, Why are you doing that? C:\home>type test.pl @dates = ( '2007:08:02 12:23', '2007:10:21 04:40', '2007:06:05 16:08', '2007:09:11 22:20', ); print "$_\n" for sort @dates; C

Re: Date::manip query

2007-12-18 Thread pauld
the END_DS field is the date field that I want - but as I couldnt get it back from the seconds since epoch field I included it. IMHO it would be tideir to just use the (numerical) date-seconds and convert it back as necessary . i used the Date::Manip function Date_SecsSince1970($m,$d,$y,$h,$mn,$

Re: Date::manip query

2007-12-18 Thread Rob Dixon
pauld wrote: > im importing data from an excel spreadsheet into an array of hashes. the date is initially converted using Date::Format::Excel. for this bit {START} = unix start time .{START_DS} = string that I use to convert to unixtime with my $var=0;my [EMAIL PROTECTED]; while ($var<$va_leng

Re: Date::manip query

2007-12-17 Thread Chas. Owens
On Dec 18, 2007 1:05 AM, John W. Krahn <[EMAIL PROTECTED]> wrote: snip > > printf ( > > "%s from $s to %s duration %s %s\n", snip You missed the usage of $s instead of %s. I always get bitten by that. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: Date::manip query

2007-12-17 Thread John W . Krahn
On Monday 17 December 2007 15:40, [EMAIL PROTECTED] wrote: > > On Dec 17, 3:22 am, [EMAIL PROTECTED] (Pauld) wrote: > > > > my $var=0;my [EMAIL PROTECTED]; > > while ($var<$va_length) > > { > > print "${$daylistsorted[$var]}{TH} "; > > print 'from '; > > print ${$daylistsorted[$var]}{START}; > >

Re: Date::manip query

2007-12-17 Thread davidfilmer
On Dec 17, 3:22 am, [EMAIL PROTECTED] (Pauld) wrote: > my $var=0;my [EMAIL PROTECTED]; > while ($var<$va_length) > { > print "${$daylistsorted[$var]}{TH} "; > print 'from '; > print ${$daylistsorted[$var]}{START}; > print ' to '.${$daylistsorted[$var]}{END_DS}; > print " duration ";print int

Re: Date::manip query

2007-12-17 Thread pauld
im importing data from an excel spreadsheet into an array of hashes. the date is initially converted using Date::Format::Excel. for this bit {START} = unix start time .{START_DS} = string that I use to convert to unixtime with my $var=0;my [EMAIL PROTECTED]; while ($var<$va_length) { print "${$d

Re: Date::manip query

2007-12-16 Thread Rob Dixon
pauld wrote: > im using Date::Manip to convert dates and times eg 2007:08:02 12:23 to allow me to sort them, which it does . but I cant see how to get the number back into a human -readable format print scalar localtime($var{STARTTIME}); prints the long string . is there a better way to get ju

Re: Date::manip query

2007-12-16 Thread John W . Krahn
On Sunday 16 December 2007 04:31, pauld wrote: > > im using Date::Manip to convert dates and times eg 2007:08:02 12:23 > to allow me to sort them, which it does . > but I cant see how to get the number back into a human -readable > format Use the UnixDate() function that comes with Date::Manip.

Date::manip query

2007-12-16 Thread pauld
im using Date::Manip to convert dates and times eg 2007:08:02 12:23 to allow me to sort them, which it does . but I cant see how to get the number back into a human -readable format print scalar localtime($var{STARTTIME}); prints the long string . is there a better way to get just the bits I wan