Re: Unsatisfied dependencies detected during OALDERS/HTTP-Date-6.05.tar.gz

2020-01-29 Thread Shlomi Fish
seeing this in an endless loop (ad infinitum) on Fedora 1, Ubuntu > 4, CentOS 5 and Fedora 31. > I can reproduce this on fedora 31 x86-64 too. > Running make for O/OA/OALDERS/HTTP-Date-6.05.tar.gz > Unsatisfied dependencies detected during > OALDERS/HTTP-Date-

Unsatisfied dependencies detected during OALDERS/HTTP-Date-6.05.tar.gz

2020-01-28 Thread Jeffrey Walton
Hi Everyone, I'm trying to build Perl 5.30.1 from sources. I'm using: ./Configure -des -Dextras="HTTP::Daemon HTTP::Request Test::More Text::Template" I'm seeing this in an endless loop (ad infinitum) on Fedora 1, Ubuntu 4, CentOS 5 and Fedora 31. Running make f

Re: Regex for date

2018-08-25 Thread Chris Charley
"Asad" wrote in message news:cag3lskh4dphjg18c-jxmo8bcqfd+vix5tep1ytsp4_6pd6z...@mail.gmail.com... Hi All , I need a regex to match the date : Sat Aug 25 08:41:03 2018 and covert into a format :'%m/%d/%Y %H:%M:%S' Thanks, -- Asad Hasan +91 95821116

Re: Regex for date

2018-08-25 Thread Jim Gibson
Many Perl modules have been written to parse and manipulate dates and times. Some come with Perl; others are available at www.cpan.org. Check out the Date::Manip, Date::Parse, or DateTime modules. > On Aug 25, 2018, at 4:06 AM, Asad wrote: > > Hi All , > > I need a

Re: Regex for date

2018-08-25 Thread Asad
can start from here and find a nicer form of this regex. > > On 8/25/18 2:06 PM, Asad wrote: > > Hi All , > > I need a regex to match the date : Sat Aug 25 08:41:03 2018 and > covert into a format : '%m/%d/%Y %H:%M:%S' > > Thanks, > > -- > Asad Hasan > +91 9582111698 > > > -- Asad Hasan +91 9582111698

Re: Regex for date

2018-08-25 Thread Home Linux Info
regex to match the date : Sat Aug 25 08:41:03 2018 and covert into a format :  '%m/%d/%Y %H:%M:%S' Thanks, -- Asad Hasan +91 9582111698

Re: Regex for date

2018-08-25 Thread Mike Flannigan
Really, no attempt to do it yourself? Mike On 8/25/2018 6:06 AM, beginners-digest-h...@perl.org wrote: Hi All ,           I need  a regex to match the date : Sat Aug 25 08:41:03 2018 and covert into a format :  '%m/%d/%Y %H:%M:%S' Thanks, -- Asad Hasan

Regex for date

2018-08-25 Thread Asad
Hi All , I need a regex to match the date : Sat Aug 25 08:41:03 2018 and covert into a format : '%m/%d/%Y %H:%M:%S' Thanks, -- Asad Hasan +91 9582111698

Re: Regex for date format

2018-06-29 Thread Mike Martin
Worked perfectly thanks, uri, and same technique works perfectly in postgresql regexp_replace for info On 29 June 2018 at 16:18, Mike Martin wrote: > Thanks > > > On Fri, 29 Jun 2018, 15:48 Uri Guttman, wrote: > >> On 06/29/2018 10:41 AM, Mike Martin wrote: >> >> sorry >> -mm-dd hh:mm:ss.dd

Re: Regex for date format

2018-06-29 Thread Mike Martin
Thanks On Fri, 29 Jun 2018, 15:48 Uri Guttman, wrote: > On 06/29/2018 10:41 AM, Mike Martin wrote: > > sorry > -mm-dd hh:mm:ss.dd > eg: > 2018-01-01 12-45-10-456789 to > 2018-01-01 12:45:10.456789 > > > > please reply to the list and not to me! > > then why did you want lookbehind? this

Re: Regex for date format

2018-06-29 Thread Uri Guttman
On 06/29/2018 10:41 AM, Mike Martin wrote: sorry -mm-dd hh:mm:ss.dd eg: 2018-01-01 12-45-10-456789 to 2018-01-01 12:45:10.456789 please reply to the list and not to me! then why did you want lookbehind? this is very easy if you just grab the time parts and reassemble them as you wan

Re: Regex for date format

2018-06-29 Thread Uri Guttman
On 06/29/2018 09:32 AM, Mike Martin wrote: Hi I am trying to convert a string of the format 2018-01-01 16-45-21-654278 to a proper timestamp string so basically I want to replace all -  after the date part i am not sure what you are trying to do. show the after text that you want. a proper

Regex for date format

2018-06-29 Thread Mike Martin
Hi I am trying to convert a string of the format 2018-01-01 16-45-21-654278 to a proper timestamp string so basically I want to replace all - after the date part I am getting a bit stuck, lookbehind doesnt seem to work as it includes the lookbehind on every occurence last attempt is s

Re: Changing date format using carpout

2017-03-26 Thread X Dungeness
The rest of it: use Time::Piece; use CGI::Carp (carpout); { local *CGI::Carp::stamp = sub {... }; open( my $log, ">>", "/path/to/error.log") or die $!; carpout($log); carp("foo happened"); # close($log) } carp("foo again but with module's timestamp"); On Sun, Mar 26, 2017 at 3:04 PM,

Re: Changing date format using carpout

2017-03-26 Thread X Dungeness
Shawn may have a different take but I think the "local" is misplaced and goes out of scope when the call's made. Here's a potential workaround: out of scope On Sun, Mar 26, 2017 at 2:02 PM, SSC_perl wrote: >> On Mar 26, 2017, at 1:15 PM, Shawn H Corey wrote: >> >> it would mean replacing the s

Re: Changing date format using carpout

2017-03-26 Thread SSC_perl
> On Mar 26, 2017, at 1:15 PM, Shawn H Corey wrote: > > it would mean replacing the subroutine after the module was loaded. Thanks, Shawn, but I can’t get that to work. Reading perldoc Core gives me the impression that I’d need to call the new sub, not the module. If that’s true, I d

Re: Changing date format using carpout

2017-03-26 Thread Shawn H Corey
On Sun, 26 Mar 2017 11:28:44 -0700 SSC_perl wrote: > > On Mar 25, 2017, at 8:58 PM, Jim Gibson > > wrote: > > > > You could also try overriding the supplied function of the imported > > module with your own version (not sure exactly how that is done). > > Hmm… me neither, but it’s a go

Re: Changing date format using carpout

2017-03-26 Thread SSC_perl
> On Mar 26, 2017, at 1:20 AM, X Dungeness wrote: > > but you could post-process the logfile in an END {} block I wouldn't have thought of that. Thanks! This now gives me a cleaner log to scan — streamlining the timestamp and adding a blank line between entries. I also learne

Re: Changing date format using carpout

2017-03-26 Thread SSC_perl
> On Mar 25, 2017, at 8:58 PM, Jim Gibson wrote: > > You could also try overriding the supplied function of the imported module > with your own version (not sure exactly how that is done). Hmm… me neither, but it’s a good idea. I’ll contact the maintainer of CGI::Carp to see if that c

Re: Changing date format using carpout

2017-03-26 Thread X Dungeness
open(_STDERR,'>&STDERR'); close STDERR; > open (my $log, '>>', 'logs/error.log') or warn("Couldn't open > error.log: $! \n"); > carpout($log); > close ($log); > } > > However, I would

Re: Changing date format using carpout

2017-03-25 Thread Jim Gibson
TDERR; > open (my $log, '>>', 'logs/error.log') or warn("Couldn't open > error.log: $! \n"); > carpout($log); > close ($log); > } > > However, I would like to change the date format. I’m not wild about > seeing th

Changing date format using carpout

2017-03-25 Thread SSC_perl
;) or warn("Couldn't open error.log: $! \n"); carpout($log); close ($log); } However, I would like to change the date format. I’m not wild about seeing the the full timestamp on every line: [Sat Mar 25 08:05:58 2017] Is there a way I can format that to my liki

Re: Wanted: Help performing Date-Time Arithmetic using emacs/vi and perl

2016-04-19 Thread Shlomi Fish
nd then execute the above VI/Ex command you get: > 4*atan(1))=3.14159265358979 > > > Here is my failed attempt to do date arithmetic: > (use Date::Calc ( ":all" ); use Date::Manip; my ( $date, $yy, $dd, $mm ); > $date = scalar localtime( ( time() - ( 24 * 60 * 60 ) )

Wanted: Help performing Date-Time Arithmetic using emacs/vi and perl

2016-04-18 Thread Richard Heintze via beginners
m the camel book) followed by an equal sign followed by any trailing garbage and evaluates the expression inside the balanced parans. so if you type (4*atan(1))=gobblygook and then execute the above VI/Ex command you get: 4*atan(1))=3.14159265358979 Here is my failed attempt to do date arithmetic

Re: Can the Perl module Date::Calc be added to Cygwin please?

2016-02-28 Thread Bob Goolsby
Mornin' -- You will need to direct the request to the Cygwin Project ( https://www.cygwin.com/ ). B On Sun, Feb 28, 2016 at 4:22 PM, Kenneth Wolcott wrote: > Hi; > > Can the Perl module Date::Calc be added to Cygwin please? > > Thanks, > Ken Wolcott > >

Can the Perl module Date::Calc be added to Cygwin please?

2016-02-28 Thread Kenneth Wolcott
Hi; Can the Perl module Date::Calc be added to Cygwin please? Thanks, Ken Wolcott -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Date::Parse and strange dates

2014-07-26 Thread Janek Schleicher
On 25.07.2014 18:54, Chris Knipe wrote: I have the odd (very rare) case where I am given a date in an incorrect format. I already use Date::Parse to convert the dates to a unix timestamp, and it’s working incredibly well. However, on the rare case that I get incorrect dates, Date::Parse does

Re: Date::Parse and strange dates

2014-07-25 Thread Rob Dixon
On 25/07/2014 17:54, Chris Knipe wrote: Hi All, I have the odd (very rare) case where I am given a date in an incorrect format. I already use Date::Parse to convert the dates to a unix timestamp, and it’s working incredibly well. However, on the rare case that I get incorrect dates, Date

Re: Date::Parse and strange dates

2014-07-25 Thread Jim Gibson
On Jul 25, 2014, at 9:54 AM, Chris Knipe wrote: > Hi All, > > I have the odd (very rare) case where I am given a date in an incorrect > format. I already use Date::Parse to convert the dates to a unix timestamp, > and it’s working incredibly well. However, on the rare

Re: Date::Parse and strange dates

2014-07-25 Thread Brian Fraser
On Fri, Jul 25, 2014 at 6:54 PM, Chris Knipe wrote: > Hi All, > > > > I have the odd (very rare) case where I am given a date in an incorrect > format. I already use Date::Parse to convert the dates to a unix timestamp, > and it’s working incredibly well. However, on the

Re: Date::Parse and strange dates

2014-07-25 Thread Chris Knipe
pon the consistency of your one bad case (presuming the > date string is in $_ for the moment): > if ( s/(\w+, \s+ \d+ \s+ \w+ \s+ \d+ \s+ [\d:]+) ([+-]\d+/$1 $2/xms ) > warn("Fixed bad date str $_\n"); > } > > either after Date::Parse has failed (and so retry) or a te

Re: Date::Parse and strange dates

2014-07-25 Thread Andy Bach
On Fri, Jul 25, 2014 at 11:54 AM, Chris Knipe wrote: > Thu, 23 Oct 2008 12:06:48+0400 > > > > Note the lack of a space between the seconds and the timezone. > Well, depending upon the consistency of your one bad case (presuming the date string is in $_ for the moment): if (

Re: Date::Parse and strange dates

2014-07-25 Thread Shawn H Corey
On Fri, 25 Jul 2014 18:54:25 +0200 Chris Knipe wrote: > Is there a simple quick way to fix that by means of a regex? Have you checked Regexp::Common ? It has a whole bunch of date regexps. -- Don't stop where the ink does. Shawn -- To unsubscribe, e-mail: beginners-

Date::Parse and strange dates

2014-07-25 Thread Chris Knipe
Hi All, I have the odd (very rare) case where I am given a date in an incorrect format. I already use Date::Parse to convert the dates to a unix timestamp, and it's working incredibly well. However, on the rare case that I get incorrect dates, Date::Parse does not like them either and e

Re: baby perl to get the right date

2014-01-30 Thread Jim Gibson
On Jan 27, 2014, at 11:32 PM, Luca Ferrari wrote: > Hi all, > often I find myself writing something like the following to get the > "human" date: > > my ($day, $month, $year) = (localtime())[3..5]; > $month++, $year += 1900; > print "\nToday is $month / $day

Re: baby perl to get the right date

2014-01-29 Thread SSC_perl
On Jan 28, 2014, at 8:59 PM, Rob Dixon wrote: > It is probably best to use the Time::Piece module, which has been part of > core Perl 5 since version 10 Side question: does anyone know why the Perl team chose Time::Piece over Date::Time to be bundled with Perl? I've known

Re: baby perl to get the right date

2014-01-28 Thread Luca Ferrari
On Wed, Jan 29, 2014 at 5:59 AM, Rob Dixon wrote: > It is probably best to use the Time::Piece module, which has been part of > core Perl 5 since version 10 so you shouldn't need to install it. > Thanks, I was not aware of it. And it does what I need. Luca -- To unsubscribe, e-mail: beginners-

Re: baby perl to get the right date

2014-01-28 Thread Rob Dixon
On 28/01/2014 07:32, Luca Ferrari wrote: Hi all, often I find myself writing something like the following to get the "human" date: my ($day, $month, $year) = (localtime())[3..5]; $month++, $year += 1900; print "\nToday is $month / $day / $year \n"; I was wondering if there

Re: baby perl to get the right date

2014-01-28 Thread David Precious
On Tue, 28 Jan 2014 08:32:20 +0100 Luca Ferrari wrote: > Hi all, > often I find myself writing something like the following to get the > "human" date: > > my ($day, $month, $year) = (localtime())[3..5]; > $month++, $year += 1900; > print "\nToday is $mon

Re: baby perl to get the right date

2014-01-28 Thread Dr.Ruud
On 2014-01-28 08:32, Luca Ferrari wrote: often I find myself writing something like the following to get the "human" date: my ($day, $month, $year) = (localtime())[3..5]; $month++, $year += 1900; print "\nToday is $month / $day / $year \n"; I was wondering if there's

Re: baby perl to get the right date

2014-01-27 Thread marcos rebelo
all, > often I find myself writing something like the following to get the > "human" date: > > my ($day, $month, $year) = (localtime())[3..5]; > $month++, $year += 1900; > print "\nToday is $month / $day / $year \n"; > > > I was wondering if there's a

Re: baby perl to get the right date

2014-01-27 Thread Chankey Pathak
Hi Luca, Check this: http://stackoverflow.com/questions/11020812/todays-date-in-perl-in-mm-dd--format On 28 January 2014 13:02, Luca Ferrari wrote: > Hi all, > often I find myself writing something like the following to get the > "human" date: > > my ($day, $m

baby perl to get the right date

2014-01-27 Thread Luca Ferrari
Hi all, often I find myself writing something like the following to get the "human" date: my ($day, $month, $year) = (localtime())[3..5]; $month++, $year += 1900; print "\nToday is $month / $day / $year \n"; I was wondering if there's a smarter pattern to get the right

Re: Fetching File Creation Date

2013-08-21 Thread John Aten
On Aug 19, 2013, at 7:27 PM, beginners-digest-h...@perl.org wrote: > > beginners Digest 20 Aug 2013 00:27:53 - Issue 4569 > > Topics (messages 123372 through 123374): > > Re: Fetching File Creation Date > 123372 by: John Aten > 123373 by: Shawn H Core

Re: Fetching File Creation Date

2013-08-17 Thread Jim Gibson
On Aug 16, 2013, at 2:25 PM, John Aten wrote: > Hi all, > > I am working on a script to rename files after a formula (discussed here: > http://www.drbunsen.org/naming-and-searching-files-part-1/ ) . The formula > calls for an ID string that is constructed from the date and t

Re: Fetching File Creation Date

2013-08-17 Thread Shawn H Corey
On Sat, 17 Aug 2013 08:57:14 -0500 John Aten wrote: > Thanks for the reply. I was taking 'creation time' as the time of the > first save. Does that matter? In UNIX et al., there is no such thing. There are 3 times stored in most file systems (FS) under UNIX. atime -- access time, the time of th

Re: Fetching File Creation Date

2013-08-17 Thread John Aten
From: Lawrence Statton Date: August 16, 2013 6:09:15 PM CDT To: beginners@perl.org Subject: Re: Fetching File Creation Date On 08/16/2013 04:25 PM, John Aten wrote: > Does anyone know if this is possible? Or should I just accept the > fact that all dates before 8/2013 are suspect? >&

Re: Fetching File Creation Date

2013-08-16 Thread Lawrence Statton
On 08/16/2013 04:25 PM, John Aten wrote: > Hi all, > [deletia] > Does anyone know if this is possible? Or should I just accept the > fact that all dates before 8/2013 are suspect? > There is no datum that is closely correlated to the "file creation" time. -- To unsubscribe, e-mail: beginners-u

Fetching File Creation Date

2013-08-16 Thread John Aten
Hi all, I am working on a script to rename files after a formula (discussed here: http://www.drbunsen.org/naming-and-searching-files-part-1/ ) . The formula calls for an ID string that is constructed from the date and time the file is created, of the format YYYMMDD_HHMMSS. The closest

Re: Convert any date format to ISO

2013-07-27 Thread Michael Brader
On 07/26/2013 06:10 AM, Charles DeRykus wrote: On Wed, Jul 24, 2013 at 10:56 PM, Michael Brader mailto:mbra...@internode.com.au>> wrote: [...] There are at least 2 modules that can definitely do the job for you, Date::Manip::Date and DateTime (with DateTime::Format::Natur

Re: Convert any date format to ISO

2013-07-27 Thread Charles DeRykus
; >> wrote: >> >> >> On 07/25/2013 10:14 AM, mimic...@gmail.com >> <mailto:mimic...@gmail.com> wrote: >> >>> I was trying to use Date::Simple to convert date from DD-MM- >>> to ISO standard -MM-DD, but it produced error

Re: Convert any date format to ISO

2013-07-25 Thread Charles DeRykus
On Wed, Jul 24, 2013 at 10:56 PM, Michael Brader wrote: > > On 07/25/2013 10:14 AM, mimic...@gmail.com wrote: > > I was trying to use Date::Simple to convert date from DD-MM- to ISO > standard -MM-DD, but it produced error below because it returned undef > when the

Re: Convert any date format to ISO

2013-07-24 Thread Michael Brader
On 07/25/2013 03:26 PM, Jim Gibson wrote: You don't need a module to recognize a date in the form DD-MM- and change it into the form -MM-DD (untested): if( $date =~ /^(\d\d)-(\d\d)-(\d\d\d\d)$/ ) { $date = "$3-$2-$1"; }else{ # try other conversions } Jim&

Re: Convert any date format to ISO

2013-07-24 Thread Jim Gibson
On Jul 24, 2013, at 5:44 PM, mimic...@gmail.com wrote: > I was trying to use Date::Simple to convert date from DD-MM- to ISO > standard -MM-DD, but it produced error below because it returned undef > when the date passed is not ISO standard. You don't need a module

Re: Convert any date format to ISO

2013-07-24 Thread Michael Brader
On 07/25/2013 10:14 AM, mimic...@gmail.com wrote: I was trying to use Date::Simple to convert date from DD-MM- to ISO standard -MM-DD, but it produced error below because it returned undef when the date passed is not ISO standard. Yeah on quick scan of the perldoc it looks like Date

Re: Convert any date format to ISO

2013-07-24 Thread mimic...@gmail.com
I was trying to use Date::Simple to convert date from DD-MM- to ISO standard -MM-DD, but it produced error below because it returned undef when the date passed is not ISO standard. $ perl -e 'use Date::Simple (":all");$date = Date::Simple->new("29-01-1972");

Re: Date::Manip DateCalc

2013-03-29 Thread Lawrence Statton
On 03/29/2013 03:01 PM, Grant wrote: I'm getting strange results from a business days calculation with Date::Manip. Everything works as expected if I use a number of days between 1 and 6, but after 6 the resulting date doesn't seem to be based on business days. It is worth no

Re: Date::Manip DateCalc

2013-03-29 Thread Grant
>> I'm getting strange results from a business days calculation with >> Date::Manip. Everything works as expected if I use a number of days >> between 1 and 6, but after 6 the resulting date doesn't seem to be >> based on business days. >> >> my

Re: Date::Manip DateCalc

2013-03-29 Thread Owen
> I'm getting strange results from a business days calculation with > Date::Manip. Everything works as expected if I use a number of days > between 1 and 6, but after 6 the resulting date doesn't seem to be > based on business days. > > my $unparsed_date = DateCalc

Date::Manip DateCalc

2013-03-29 Thread Grant
I'm getting strange results from a business days calculation with Date::Manip. Everything works as expected if I use a number of days between 1 and 6, but after 6 the resulting date doesn't seem to be based on business days. my $unparsed_date = DateCalc("today","+ 6 days

Re: Date::Manip question

2012-11-08 Thread Gerhard
On Thu, Nov 08, 2012 at 10:56:00AM +, Marco van Kammen wrote: > my $current_month =(should be Nov) > my $current_mont_num = (should be 11) > my $previous_month = (should be Oct) > my $previous_month_num = (should be 10) There is Time::Piece and

Re: Date::Manip question

2012-11-08 Thread Ken Slater
On Thu, Nov 8, 2012 at 7:42 AM, Marco van Kammen wrote: > Yeah, so something like this: > > #!/usr/bin/perl > > use strict; > use warnings; > > my $previous_month; > my $previous_month_num; > > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); > > my @months = ( 'JAN', 'F

RE: Date::Manip question

2012-11-08 Thread Marco van Kammen
evious_month_num\n"; seems to work... :-) Thanks all! Marco van Kammen Applicatiebeheerder Mirabeau | Managed ServicesDr. C.J.K. van Aalstweg 8F 301, 1625 NV Hoorn +31(0)20-5950550 - www.mirabeau.nl Please consider the environment before printing this email

Re: Date::Manip question

2012-11-08 Thread David Precious
On Thu, 8 Nov 2012 12:53:31 +0100 Rob Coops wrote: > Something like the below would do perfectly fine... > > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = > localtime(time); > > my @months = ( 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', > 'SEP', 'OCT', 'NOV', 'DEC' ); >

Re: Date::Manip question

2012-11-08 Thread Rob Coops
riables. >> >> ** ** >> >> my $current_month =(should be Nov) >> >> my $current_mont_num = (should be 11) >> >> my $previous_month = (should be Oct) >> >> my $previous_month_num = (should be 10)

Re: Date::Manip question

2012-11-08 Thread Rob Coops
t_mont_num = (should be 11) > > my $previous_month = (should be Oct) > > my $previous_month_num = (should be 10)**** > > ** ** > > I’ve been looking at the module Date::Manip to get this going, but I can’t > seem to get it working. >

Date::Manip question

2012-11-08 Thread Marco van Kammen
been looking at the module Date::Manip to get this going, but I can't seem to get it working. Any help in the right direction would be appreciated. With Kind Regards, [cid:blank1c63.gif] Marco van Kammen Applicatiebeheerder [cid:blank52fd.gif] [cid:blank4113.gif] Mirabeau | Managed Serv

log4perl rotate logs with date as suffix

2012-04-03 Thread Mukesh
Hi I'm trying to rotate my log files and also i have another requirement of having date suffix for the rotated files. For this I've used the following configuration: log4perl.appender.LOGFILE.layout=PatternLayout log4perl.appender.LOGFILE.layout.ConversionPattern =

Re: [ask] oracle date

2012-03-09 Thread Octavian Rasnita
From: "Eko Budiharto" Subject: [ask] oracle date > dear list, > I have a date data extracted from oracle, stored as this 1993-11-30 > 00:00:00. The datatype in the oracle is date. I would like to save into > mysql (the datatype is also date), I got an error. When I

Re: Of Date-Manip and Perl versions

2012-03-09 Thread Bruce Ferrell
On 03/09/2012 09:45 PM, David Christensen wrote: > On 03/08/2012 11:53 AM, Bruce Ferrell wrote: >> Just thought I'd share with the group and experience I just had. In perhaps >> the hope of sparing others of the PITA I just went through. > ... > > use Common; # cont

Re: Of Date-Manip and Perl versions

2012-03-09 Thread David Christensen
On 03/08/2012 11:53 AM, Bruce Ferrell wrote: Just thought I'd share with the group and experience I just had. In perhaps the hope of sparing others of the PITA I just went through. ... > use Common; # contains timestamp() > use Date::Manip; ... > Shouldn't this have thrown

[ask] oracle date

2012-03-09 Thread Eko Budiharto
dear list, I have a date data extracted from oracle, stored as this 1993-11-30 00:00:00. The datatype in the oracle is date. I would like to save into mysql (the datatype is also date), I got an error. When I do a small debug, I print the date directly, it comes out into 30-NOV-93. I am

Re: Of Date-Manip and Perl versions

2012-03-08 Thread Bruce Ferrell
function weren't working I first had >> to find the location of the failing code. Is it being passed it's necessary >> data. Yep... OK, so what's >> wrong? Any errors thrown? Nope. OK, extract the code into a test program >> (below, suitably "c

Of Date-Manip and Perl versions

2012-03-08 Thread Bruce Ferrell
data. Yep... OK, so what's wrong? Any errors thrown? Nope. OK, extract the code into a test program (below, suitably "cleaned" to disguise what it really is). "In circuit" the code runs as a daemon and errors aren't easy to get at. #!/usr/bin/perl -w use lib

Re: Is this one line out of date (circa 2002)

2012-02-15 Thread Harry Putnam
Rob Dixon writes: >> And then (trying to print just the time column >> perl -i -n -a -e 'print @F[6];' ping.lst >> >> But there is no output at all. > > The -i option calls for in-place editing, where the output from Perl > replaces the input file. Take a look at ping.lst and you should find >

Re: Is this one line out of date (circa 2002)

2012-02-13 Thread John W. Krahn
Rob Dixon wrote: On 13/02/2012 22:28, Harry Putnam wrote: I found some one liners on this web page: http://www.techrepublic.com/article/use-command-line-perl-to-make-unix-administration-easier/1044668 This one appears not to work at all. Can anyone say why that is? Is it just too old? From t

Re: Is this one line out of date (circa 2002)

2012-02-13 Thread Rob Dixon
On 13/02/2012 22:28, Harry Putnam wrote: I found some one liners on this web page: http://www.techrepublic.com/article/use-command-line-perl-to-make-unix-administration-easier/1044668 This one appears not to work at all. Can anyone say why that is? Is it just too old? From the cited page: ,

Is this one line out of date (circa 2002)

2012-02-13 Thread Harry Putnam
I found some one liners on this web page: http://www.techrepublic.com/article/use-command-line-perl-to-make-unix-administration-easier/1044668 This one appears not to work at all. Can anyone say why that is? Is it just too old? >From the cited page: , | The command provided using the -e op

Re: Rounding Date/Time

2011-05-06 Thread Peter Scott
On Mon, 02 May 2011 11:46:42 -0500, Matt wrote: > Have a date: > > 2011-05-02-16:40:51 [...] > > I need to round it to nearest 5 minute point. > > 2011-05-02-16:40:51 If you care about things like daylight savings time adjustments, calendar changes, or leap seconds

Re: Rounding Date/Time

2011-05-05 Thread Pete Smith
On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote: Have a date: 2011-05-02-16:40:51 Using this to get it: $tm = gmtime; $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; print &

Re: Rounding Date/Time

2011-05-04 Thread Rob Dixon
On 04/05/2011 18:14, C.DeRykus wrote: On May 3, 4:12 pm, rob.di...@gmx.com (Rob Dixon) wrote: On 03/05/2011 19:49, C.DeRykus wrote: use Time::localtime; use List::Util qw/reduce/; my @rounded_5mins = grep { not $_ % 5 } 0..60; my $curr_min = localtime->min; my $round_min = reduce { $curr_mi

Re: Rounding Date/Time

2011-05-04 Thread C.DeRykus
On May 3, 4:12 pm, rob.di...@gmx.com (Rob Dixon) wrote: > On 03/05/2011 19:49, C.DeRykus wrote: > > > > > > > > > > > On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote: > >> Have a date: > > >> 2011-05-02-16:40:51 > > >> Using

Re: Rounding Date/Time

2011-05-03 Thread Rob Dixon
On 03/05/2011 19:49, C.DeRykus wrote: On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote: Have a date: 2011-05-02-16:40:51 Using this to get it: $tm = gmtime; $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->ho

Re: Rounding Date/Time

2011-05-03 Thread C.DeRykus
On May 3, 11:54 am, shawnhco...@ncf.ca (Shawn H Corey) wrote: > On 11-05-03 02:49 PM, C.DeRykus wrote: > > > my @rounded_5mins = grep { not $_ % 5 } 0..60; > > my @rounded_5mins = map { $_ * 5 } 0..12; > > # TIMTOWTDI > Make that: TIMTOWTDI++ # a much better way to do it -- Charles DeRykus -

Re: Rounding Date/Time

2011-05-03 Thread Shawn H Corey
On 11-05-03 02:49 PM, C.DeRykus wrote: my @rounded_5mins = grep { not $_ % 5 } 0..60; my @rounded_5mins = map { $_ * 5 } 0..12; # TIMTOWTDI -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of understanding. Programming is as much about organization and commu

Re: Rounding Date/Time

2011-05-03 Thread C.DeRykus
On May 2, 9:46 am, lm7...@gmail.com (Matt) wrote: > Have a date: > > 2011-05-02-16:40:51 > > Using this to get it: > > $tm = gmtime; > $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", >  $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $

Re: Rounding Date/Time

2011-05-03 Thread Rob Dixon
On 02/05/2011 17:46, Matt wrote: Have a date: 2011-05-02-16:40:51 Using this to get it: $tm = gmtime; $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; print "$time_stamp\n&q

Re: Rounding Date/Time

2011-05-02 Thread Jim Gibson
On 5/2/11 Mon May 2, 2011 9:46 AM, "Matt" scribbled: > Have a date: > > 2011-05-02-16:40:51 > > Using this to get it: > > $tm = gmtime; > $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", > $tm->year + 1900, $tm->mon + 1, $tm->m

Re: Rounding Date/Time

2011-05-02 Thread Uri Guttman
>>>>> "M" == Matt writes: M> Have a date: M> 2011-05-02-16:40:51 M> Using this to get it: M> $tm = gmtime; M> $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", M> $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->

Rounding Date/Time

2011-05-02 Thread Matt
Have a date: 2011-05-02-16:40:51 Using this to get it: $tm = gmtime; $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; print "$time_stamp\n"; I need to round it to neares

Re: Date arithmetic advise/improvement - using stat ... calling the Perl script from a UNIX script

2011-03-10 Thread Rob Dixon
am wanting to assign to the timediff variable in the UNIX script is the string "( 5 weeks, 3 days, 10:16:1 )" but only if the file is x days old. Do I need to have something like a return timediff_detail command in the Perl script? FYI, I've decided to use stat instead of Perl

Re: Date arithmetic advise/improvement - using stat ... calling the Perl script from a UNIX script

2011-03-10 Thread Rob Dixon
X script is the string > "( 5 weeks, 3 days, 10:16:1 )" but only if the file is x days old. Do I need > to have something like a return timediff_detail command in the Perl script? > > FYI, I've decided to use stat instead of Perl Date modules because each > server h

Re: Date arithmetic advise/improvement - using stat ... calling the Perl script from a UNIX script

2011-03-10 Thread Shawn H Corey
On 11-03-10 10:33 AM, newbie01 perl wrote: #!/usr/bin/perl #$today = localtime(); $today_epoch = time(); $today = localtime($today_epoch); my @today = localtime( $today_epoch ); # When in list context, localtime returns an array that can be use with strftime @date_fields = split(" ",$toda

Date arithmetic advise/improvement - using stat ... calling the Perl script from a UNIX script

2011-03-10 Thread newbie01 perl
days old. Do I need to have something like a return timediff_detail command in the Perl script? FYI, I've decided to use stat instead of Perl Date modules because each server have different Date modules installed, some have Date::Manip, some have Date::Calc etc. so using stat is the best opti

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Jim Gibson
file.03 03-Jan-2011 0500 > .. > .. > /backup/file.31 31-Jan-2011 0500 > /backup/file.32 01-Feb-2011 0500 > /backup/file.33 02-Feb-2011 0500 > > I want the script to check the most recent file in a backup directory, i.e. > newest, for example /backup/file.33 and disp

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Shawn H Corey
On 11-03-02 12:31 PM, shawn wilson wrote: Seems like more of a pain for a modest gain in speed to me. I like find and dt because its quick and easy. Either way though. No, because you don't have to worry about daylight-savings time or switching time zones. Seconds from the epoch is the same o

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread shawn wilson
On Mar 2, 2011 12:16 PM, "Shawn H Corey" wrote: > > On 11-03-02 12:12 PM, shawn wilson wrote: >> >> First, use File::Find to get your info (or you could use system( ls -l ) and >> split - either way). To compare your time stamps, use DateTime and do dt1 - >> dt2 >> > > No. If you can do all your

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Shawn H Corey
On 11-03-02 12:12 PM, shawn wilson wrote: First, use File::Find to get your info (or you could use system( ls -l ) and split - either way). To compare your time stamps, use DateTime and do dt1 - dt2 No. If you can do all your calculations using seconds from the epoch, then do so. Only conve

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread shawn wilson
First, use File::Find to get your info (or you could use system( ls -l ) and split - either way). To compare your time stamps, use DateTime and do dt1 - dt2

Re: Scan/Parse directory for "newest" file, print file timestamp and compute date/time difference - Some advice please

2011-03-02 Thread Shawn H Corey
On 11-03-02 11:34 AM, newbie01 perl wrote: My main hurdle is the file timestamp and date arithmetic part. Frm Google'ing, am leaning towards using stat which am hoping will work on both Unix and Windows. Some guidance will be much appreciated. Thanks in advance. Use the stat function t

  1   2   3   4   5   6   7   8   9   10   >