AW: Date calculation help/suggestion please ... when there is no Date or Time module available

2010-04-07 Thread Thomas Bätzler
newbie01 perl wrote: > Problem 1: > - Is there a function to compare the two (2) dates so ensure that I > will always be doing -? At the moment, the > workaround that am doing is if I get a negative value, then that > means, I've done a - and need to change > the way I print the output. If you fa

Date calculation help/suggestion please ... when there is no Date or Time module available

2010-04-07 Thread newbie01 perl
Hi all, I have a Perl script on Windows that does date calculation and using Date::Calc, Decode_Month and Delta_YMDHMS functions Am using the script to calculate the difference between two dates, for example, for the two (2) dates below: 01/Jan/2010 04:01:27 01/Jan/2010 02:06:30 The script is

Re: Date calculation

2004-04-23 Thread Chris Charley
- Original Message - From: "Jan Eden" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Chris Charley" <[EMAIL PROTECTED]>; "Perl Lists" <[EMAIL PROTECTED]> Sent: Thursday, April 22, 2004 3:56 AM Subject: Re: Date calculation Hi Chr

RE: Date calculation

2004-04-22 Thread Jan Eden
Hi Joel, - Original Message - From: Stout, Joel R Sent: 21.04.2004, 17:46 Uhr >Call me crazy but I have visions of people asking for Winter >discounts or various future changes (prolonged Summer rates?). What >of a simple text file that contains: > > >0914|80 >0915|80 >0916|55 >0917|

Re: Date calculation

2004-04-22 Thread Jan Eden
Hi Chris, - Original Message - From: Chris Charley Sent: 21.04.2004, 18:48 Uhr >Hello Jan >Maybe something like this would do what you want :-) > >#!/usr/bin/perl >use strict; >use warnings; >use Date::Calc qw/Delta_Days Date_to_Days Add_Delta_Days/; > >my $beg = Date_to_Days(2004, 7, 1

Re: Date calculation

2004-04-21 Thread Jan Eden
- Original Message - From: WC -Sx- Jones Sent: 21.04.2004, 14:23 Uhr >Jan Eden wrote: > >> if (season($start_date) && season($end_date) { >> $season_days = Delta_Days($start_date, $end_date) >> } elsif season($start_date) { > > >try not to make it *more* complicated :) > >You posted y

Re: Date calculation

2004-04-21 Thread Chris Charley
- Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 6:48 PM Subject: Re: Date calculation > > - Original Message - > From: "Jan Eden" <[EM

Re: Date calculation

2004-04-21 Thread Chris Charley
- Original Message - From: "Jan Eden" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Perl Lists" <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 1:29 PM Subject: Date calculation Hi, I need to find the number of days between two dates. The Perl

Re: Date calculation

2004-04-21 Thread WC -Sx- Jones
Jan Eden wrote: if (season($start_date) && season($end_date) { $season_days = Delta_Days($start_date, $end_date) } elsif season($start_date) { try not to make it *more* complicated :) You posted your own answer in the first post. Consider: ((season($start_date) && (season($end_date)) ?

Re: Date calculation

2004-04-21 Thread Jan Eden
- Original Message - From: WC -Sx- Jones Sent: 21.04.2004, 13:32 Uhr >Jan Eden wrote: >> if $mmdd > 0915 and $mmdd < 0630) ... >> >> in my calculation to allow for any combination of $80 and $55 days. > >(($mmdd > 0915) && ($mmdd < 0630)) ? $55 : $80; Thanks, I imagined a test like this

Re: Date calculation

2004-04-21 Thread WC -Sx- Jones
Jan Eden wrote: if $mmdd > 0915 and $mmdd < 0630) ... in my calculation to allow for any combination of $80 and $55 days. (($mmdd > 0915) && ($mmdd < 0630)) ? $55 : $80; -- _Sx_ http://youve-reached-the.endoftheinternet.org/ _ http://jaxpm.insecurity.org/ http://cis4dl.insecurity.or

Date calculation

2004-04-21 Thread Jan Eden
Hi, I need to find the number of days between two dates. The Perl Cookbook provides this solution: use Date::Calc qw(Delta_Days); @bree = (1981, 6, 16); # 16 Jun 1981 @nat = (1973, 1, 18); # 18 Jan 1973 $difference = Delta_Days(@nat, @bree); But there's a hook: I need to calculate a

Date Calculation

2001-10-24 Thread Martin
hi to all I hav a problem with GWT i use the following code: use DateTime::Precise; my $midnight = DateTime::Precise -> new(); my $day = $now -> day; my $month= $now -> month; my $year= $now -> year; $midnight -> set_from_datetime(qq($year.$month.$day 00:00:01)); $search_start = sp

Date::Manip - Date calculation

2001-06-23 Thread Adrian Harper
Hi everyone, Im very new to Perl and am trying to write a web front end to an existing MDB that we use at work. One of the things I am wanting to do, is calculate the age of records in the MDB, each record has a text field containing the date and time in the following format "2001-06-12 15:47:0