Re: localtime output result

2012-04-02 Thread Owen
> Hi, > > I am so confused the time output result. > > Time::tm=ARRAY(0x109c3b0) > > > Here is the code: > > #!/usr/bin/env perl > > use strict; > use warnings; > use autodie qw(open close); > use 5.012; > use Time::localtime; > use File::stat; > > open my $fh, '<', "too0.tex"; > > my $time = loca

Re: localtime() oddities

2009-08-04 Thread Roman Makurin
Big thanks for replying. Just modified my mktime() call : POSIX::mktime(sec, min, hour, month, year, -1, -1, 1); and now it work as expected :) On Mon, Aug 03, 2009 at 08:42:43AM -0400, Shawn H. Corey wrote: > Roman Makurin wrote: >> Could someone explain me whats goin on :) >> > > Do you have D

Re: localtime() oddities

2009-08-03 Thread Shawn H. Corey
Roman Makurin wrote: Could someone explain me whats goin on :) Do you have Daylight Saving Time? Are both machines configured for it? -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. My favourite four-l

Re: localtime

2009-06-09 Thread John W. Krahn
Rick wrote: below is working code but is there way to shorten this code in more perlish way? my($DAY, $MONTH , $YEAR ) = (localtime)[3,4,5]; my $day = sprintf("%02d",$DAY); my $month = sprintf("%02d", ($MONTH + '1')); my $year = sprintf("%04d", ($YEAR + '1900')); Why are you using a strin

Re: localtime

2009-06-09 Thread Tech W.
use POSIX's function strftime: perl -le 'use POSIX qw/strftime/;$time = strftime "%Y%m%d",localtime; print $time' --- On Wed, 10/6/09, Rick wrote: > From: Rick > Subject: localtime > To: "Perl Beginners" > Received: Wednesday, 10 June, 2009, 9:55 AM > below is working code but is there > w

Re: Localtime minutes before or after

2003-08-17 Thread Jeff 'japhy' Pinyan
On Aug 17, Pablo Fischer said: >030817145 Does that represent... 03 -> 2003 08 -> August 17 -> 17th 14 -> 2pm 5 -> 5 minutes I'm a little wary of that form of storing the date, but I suppose we can deal with it. >However in some parts of my code I need to get another date, and I onl

Re: Localtime minutes before or after

2003-08-17 Thread Bernhard van Staveren
Localtime takes it's input either from the time() function if you call it without parameters, or from a timestamp you supply. So, if I wanted the current date and time, but 10 minutes into the future I'd do: my $mydate=localtime( time() + 600 ); (600 seconds being 10 minutes, added to the curre

Re: localtime question - zero padding - mnth discrepancy

2002-12-16 Thread John W. Krahn
Harry Putnam wrote: > > "John W. Krahn" <[EMAIL PROTECTED]> writes: > > > printf " %02d/%02d/%04d %02d:%02d:%02d\n", $lta[4] + 1, $lta[3], $lta[5] + 1900, >@lta[2,1,0]; > > Thanks.. the tips work good. And I overlooked the part about mnths > being 0-11. > > I get the idea from your posted pri

Re: localtime question - zero padding - mnth discrepancy

2002-12-16 Thread Harry Putnam
Toby Stuart <[EMAIL PROTECTED]> writes: > Check the length of second, minute and hour. > If the length == 1 then add a leading zero eg. $sec = "0" . $sec > Maybe there is some other "magical" way of doing this, if there is i'm not > aware of it :) Good idea... thanks. "John W. Krahn" <[EMAIL P

Re: localtime question - zero padding - mnth discrepancy

2002-12-15 Thread John W. Krahn
Harry Putnam wrote: > > I really have two questions here: > > 1) How can I get padded numbers in the single digit range in this >script? perldoc -f sprintf perldoc -f printf perldoc POSIX# look for the strftime function > 2) Hoping tbis isn't some glaring mistake and I'm too blind to s

RE: localtime question - zero padding - mnth discrepancy

2002-12-15 Thread Toby Stuart
> -Original Message- > From: Harry Putnam [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 16, 2002 3:15 PM > To: [EMAIL PROTECTED] > Subject: localtime question - zero padding - mnth discrepancy > > > > I really have two questions here: > > 1) How can I get padded numbers in the s

Re: localtime

2002-11-22 Thread Jeff 'japhy' Pinyan
On Nov 22, John W. Krahn said: >@mons = ( qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/ ) x 2; >$mon = (localtime)[4] + 12; >print "@mons[$mon - 5 .. $mon]" Why the double array? (-5 .. 0) works just as well as (6 .. 11). -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobo

Re: localtime

2002-11-22 Thread John W. Krahn
Jonathan Musto wrote: > > Hi all, Hello, > Does anyone know how to get the last six months into an array? > > ive got: > my $month = (split ' ', uc localtime)[1]; > to get the current month and now i want to get the previous 5 months, is > there any way to perform arithmetic on the month value!

Re: localtime

2002-11-22 Thread Jeff 'japhy' Pinyan
On Nov 22, [EMAIL PROTECTED] said: >Does anyone know how to get the last six months into an array? my @mon = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); >my $month = (split ' ', uc localtime)[1]; >to get the current month and now i want to get the previous 5 months, is >there any wa

Re: localtime ()

2002-10-29 Thread Tanton Gibbs
Yes, or you might try removing it entirely...it could be what is messing you up. - Original Message - From: "Goodman Kristi - kgoodm" <[EMAIL PROTECTED]> To: "'Tanton Gibbs'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, October 2

RE: localtime ()

2002-10-29 Thread Goodman Kristi - kgoodm
I have this line in my autoexec.bat: SET TZ=CST Can I just change it to this: set tz=CST+06CDT -Original Message- From: Tanton Gibbs [mailto:thgibbs@;deltafarms.com] Sent: Monday, October 28, 2002 9:43 PM To: Goodman Kristi - kgoodm; [EMAIL PROTECTED] Subject: Re: localtime () I

RE: localtime ()

2002-10-29 Thread Goodman Kristi - kgoodm
ton Gibbs [mailto:thgibbs@;deltafarms.com] Sent: Monday, October 28, 2002 9:43 PM To: Goodman Kristi - kgoodm; [EMAIL PROTECTED] Subject: Re: localtime () I don't know what your timezone is, so I'm going to assume central since you work with acxiom (I do too!) try this at the dos prompt before you

Re: localtime ()

2002-10-28 Thread Tanton Gibbs
I don't know what your timezone is, so I'm going to assume central since you work with acxiom (I do too!) try this at the dos prompt before you run the perl script. set tz=CST+06CDT or set TZ=CST6CDT or set TZ=GMT-6 (I've seen it all three ways) this will set your tz environment variable for

Re: localtime ()

2002-10-28 Thread Greg Oliver
Sorry - I am off on another tangent here.. "use locale;" is definately not what you need. I should read more closely! -Greg On Mon, 28 Oct 2002 09:38:18 -0600 Goodman Kristi - kgoodm <[EMAIL PROTECTED]> wrote: > I asked this question about a week ago but still have not found a > solution. >

Re: localtime ()

2002-10-28 Thread Greg Oliver
Have you tried: use locale; I suggested `perldoc perllocale` because I was not sure if you could use it on M$ platforms, but after I did a few seconds of research, I learned you can since it is partially POSIX compliant. This should tell perl what your locale (timezone offset from GMT/country co

RE: LOCALTIME question

2002-10-22 Thread Bob Rasey
On Tue, 2002-10-22 at 16:25, Goodman Kristi - kgoodm wrote: > LocalTime:Tue Oct 22 20:18:31 2002 > Net Time: Current time at \\kgoodm is 10/22/2002 3:18 PM Since minutes are different too, I would suspect software and system clocks aren't sync'ed. ..02 Bob Rasey -- To unsubscribe, e

RE: LOCALTIME question

2002-10-22 Thread Goodman Kristi - kgoodm
y, October 22, 2002 2:46 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: LOCALTIME question I think "net time" will return UCT, or Universal Coordinated Time, which used to be known as Greenwich Mean Time. If you were to just type "time" at the DOS prompt or "dat

RE: LOCALTIME question

2002-10-22 Thread Goodman Kristi - kgoodm
] Subject: Re: LOCALTIME question I think "net time" will return UCT, or Universal Coordinated Time, which used to be known as Greenwich Mean Time. If you were to just type "time" at the DOS prompt or "date" at the *nix prompt, the time should

Re: LOCALTIME question

2002-10-22 Thread shawn_milochik
I think "net time" will return UCT, or Universal Coordinated Time, which used to be known as Greenwich Mean Time. If you were to just type "time" at the DOS prompt or "date" at the *nix prompt, the time should agree with LOCALTIME. Shawn

Re: LOCALTIME question

2002-10-22 Thread Jenda Krynicky
> My localtime function returns this: Tue Oct 22 18:30:53 2002 > > > I am in the Central Time zone and my machine time (net time at DOS > prompt) returns this: 10/22/2002 1:37 PM > > > Does anyone have any idea why my localtime is 5 hours ahead? Go to Control Panel\Date/Time and make sure the

Re: LOCALTIME question

2002-10-22 Thread Greg Oliver
Your locale is not set to CST6CDT. See 'perldoc perllocale' -G On Tue, 22 Oct 2002 13:38:47 -0500 Goodman Kristi - kgoodm <[EMAIL PROTECTED]> wrote: > My localtime function returns this: Tue Oct 22 18:30:53 2002 > > > I am in the Central Time zone and my machine time (net time at DOS > pro

Re: localtime help

2002-04-17 Thread Ramis
James Kelty wrote: > > Can someone point me to the perldoc's that can help me get the localtime > equivalent of the shell command /bin/date +'%Y%m%d' ? > > Thanks! > > -James > > James Kelty > Sr. Unix Systems Administrator > Everbase Systems > 541.488.0801 > [EMAIL PROTECTED] > use Time::loc

Re: localtime help

2002-04-16 Thread Jenda Krynicky
From: "James Kelty" <[EMAIL PROTECTED]> > Can someone point me to the perldoc's that can help me get the > localtime equivalent of the shell command /bin/date +'%Y%m%d' ? I believe you are looking for perldoc POSIX Jenda === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz

Re: localtime help

2002-04-16 Thread Jeff 'japhy' Pinyan
On Apr 16, James Kelty said: >Can someone point me to the perldoc's that can help me get the localtime >equivalent of the shell command /bin/date +'%Y%m%d' ? Either perldoc -f localtime and roll your own, or read perldoc POSIX and look for strftime(). It uses the same format strings as