Re: use Time::Piece

2018-11-01 Thread Martin McCormick
Jim Gibson writes: > On Oct 31, 2018, at 1:29 PM, Martin McCormick > wrote: > > my $t1 = Time::Piece->strptime("$obtime[1], %d %b %Y %H:%M:%S %z”); > > strptime is a method with two arguments: string to be parsed, format to > be used for parsing. You have one argument: a double-quoted string

Re: use Time::Piece

2018-11-01 Thread Martin McCormick
Sam writes: > > > > None of your arguments are right. For one, you are using the '%D' flag > which is the same as saying '%m/%d/%y' > > > This works fine from a quick command line test: > > perl -e 'use Time::Piece; $t = "30 Oct

Re: use Time::Piece

2018-10-31 Thread Sam
ng but a miss is the same as close so I can't tell if I am getting warm. Thanks for any ideas. Martin McCormick None of your arguments are right. For one, you are using the '%D' flag which is the same as saying '%m/%d/%y' This works fine from a quick command l

Re: use Time::Piece

2018-10-31 Thread Jim Gibson
On Oct 31, 2018, at 1:29 PM, Martin McCormick wrote: > > > I'd like to say that it's working but not yet. There seems to be > nothing wrong with the string now. > > my $t1 = Time::Piece->strptime("$obtime[1], %d %b %Y %H:%M:%S %z”); strptime is a method with two arguments: string to be parse

Re: use Time::Piece

2018-10-31 Thread Martin McCormick
("$obtime[1], %d %b %Y %H:%M:%S %z"); Still the parse error. Right now, I do have both use Time::Local; use Time::Piece; in the program and Time::Piece is supposed to replace many of the functions of Time::Local. If I comment out Time::Local, a reference to gntime breaks.

Re: use Time::Piece

2018-10-30 Thread Uri Guttman
On 10/30/18 11:24 PM, Martin McCormick wrote: I can not seem to send Time::Piece any syntax it likes. The file I am reading sends a time stamp that should conform to RFC822 date stamps. An example of a stamp follows: main::(lwx:204):my @obtime = split( /\,+/, $data-

use Time::Piece

2018-10-30 Thread Martin McCormick
etting warm. Thanks for any ideas. Martin McCormick Code follows: #!/usr/bin/perl -w use strict; use warnings::unused; use Data::Dumper; use XML::Simple; use File::Basename; use Cwd; use File::stat; use Time::Local; use Time::Piece; my $homedir = "/tmp"; my @t = localtime(ti