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-
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
"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
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
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
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
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
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
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
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
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
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
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
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,
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
> 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
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
> 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
> 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
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
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
;) 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
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 ) )
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
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
>
>
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/
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
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
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
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
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
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 (
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-
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
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
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
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-
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
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
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
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
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
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
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
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
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
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?
>&
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
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
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
;
>> 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
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
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&
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
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
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");
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
>> 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
> 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
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
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
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
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
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' );
>
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)
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.
>
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
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 =
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
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
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
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
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
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
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
>
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
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:
,
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
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
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 &
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
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
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
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
-
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
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, $
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
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
>>>>> "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->
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
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
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
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
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
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
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
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
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
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
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 - 100 of 987 matches
Mail list logo