Re: Finding my localtime

2015-02-04 Thread SSC_perl
On Feb 4, 2015, at 5:20 PM, Shawn H Corey wrote: > > I seems to me if you change locales, you would necessarily change > timezones too. But I haven't done much playing around with locales. :( Me neither, but I'm learning more than I thought I would! ;) Looking at the locales for just th

Re: Finding my localtime

2015-02-04 Thread SSC_perl
On Feb 4, 2015, at 4:30 PM, Shawn H Corey wrote: > > Have you read `perldoc perllocale` especially the `setlocale` function? > http://perldoc.perl.org/perllocale.html#The-setlocale-function Actually, I did, but unless I read it incorrectly, it doesn't appear to have anything to do with t

Re: Finding my localtime

2015-02-04 Thread Shawn H Corey
On Wed, 4 Feb 2015 11:21:32 -0800 SSC_perl wrote: > I'm trying to break out a timestamp into it's appropriate fields, > like so: > > my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = > localtime($my_time); > > but no matter if I use localtime or

Re: Finding my localtime

2015-02-04 Thread SSC_perl
On Feb 4, 2015, at 1:55 PM, $Bill wrote: > > I had a similar situation where I'm in Pacific time and my server is in > Eastern time. > > My solution was to just add this to my BEGIN { } : > $ENV{TZ} = 'PST8PDT'; > to force my time displays to Pacific time. I didn't think about add

Finding my localtime

2015-02-04 Thread SSC_perl
I'm trying to break out a timestamp into it's appropriate fields, like so: my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($my_time); but no matter if I use localtime or gmtime, $my_time gets analyzed as either in the server's timezone or

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::s

localtime output result

2012-04-02 Thread lina
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 = localtime; m

Re: Using the Time::localtime module??

2010-10-08 Thread Gopal Karunakar
wrote: > > Hi All, > > > > I am using the Time::localtime module in my perl script for getting a > > particular date format. It was working fine till last month, but for the > > month of October it is seen that it's showing as September. I am pasting > a

Re: Using the Time::localtime module??

2010-10-08 Thread Shlomi Fish
Hi GK, On Friday 08 October 2010 10:02:34 Gopal Karunakar wrote: > Hi All, > > I am using the Time::localtime module in my perl script for getting a > particular date format. It was working fine till last month, but for the > month of October it is seen that it's showin

Using the Time::localtime module??

2010-10-08 Thread Gopal Karunakar
Hi All, I am using the Time::localtime module in my perl script for getting a particular date format. It was working fine till last month, but for the month of October it is seen that it's showing as September. I am pasting a copy of my code below: sub getLocalTime { my $tm = localtime

Re: timezone issue with gettimeofday and localtime

2010-10-03 Thread Shlomi Fish
hour, $day, $month, $year ); You shouldn't predeclare all these variables here. Declare them when they are needed. You also have both $sec and $seconds which is confusing. > my $time_pointer = 0; > > # (1) Print a current microsecond timestamp > ( $seconds, $usec ) = gettimeofday(); >

timezone issue with gettimeofday and localtime

2010-10-03 Thread JP
nings; use strict; use Time::HiRes qw(gettimeofday); my ( $seconds, $usec, $sec, $min, $hour, $day, $month, $year ); my $time_pointer = 0; # (1) Print a current microsecond timestamp ( $seconds, $usec ) = gettimeofday(); ( $sec, $min, $hour ) = localtime( $seconds + $usec / 100 - $time_po

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

localtime() oddities

2009-08-03 Thread Roman Makurin
Hi All! I have a strange problem. Here is sample code: perl -MPOSIX -le 'print scalar localtime(POSIX::mktime(0,30,14,03,07,109))' When i test it on my laptop, everything goes fine, its output is: Mon Aug 3 14:30:00 2009 But when im trying to execute it on freebsd server i

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",

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, 200

localtime

2009-06-09 Thread Rick
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 + &#x

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Adriano Ferreira wrote: On 9/3/07, Shams Fantar <[EMAIL PROTECTED]> wrote: Hello, I want to give a date (the year, the day, the hour and the minute) to a file. So, I use localtime function. But I don't understand how to use localtime (after reading the documentation on this fun

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Adriano Ferreira
On 9/3/07, Shams Fantar <[EMAIL PROTECTED]> wrote: > Hello, > > I want to give a date (the year, the day, the hour and the minute) to a > file. So, I use localtime function. But I don't understand how to use > localtime (after reading the documentation on this functio

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Jeff Pang wrote: 2007/9/3, Shams Fantar <[EMAIL PROTECTED]>: Jeff Pang wrote: try the POSIX::strftime,this use the same datetime format as shell's date command. perl -e ' use POSIX qw/strftime/; print strftime("%y%m%d %H:%M",localtime); ' 070903 21:51

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Jeff Pang
2007/9/3, Shams Fantar <[EMAIL PROTECTED]>: > Jeff Pang wrote: > > try the POSIX::strftime,this use the same datetime format as shell's > > date command. > > > > perl -e ' > > use POSIX qw/strftime/; > > print strftime("%y%m%d %H:%M

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Jeff Pang wrote: try the POSIX::strftime,this use the same datetime format as shell's date command. perl -e ' use POSIX qw/strftime/; print strftime("%y%m%d %H:%M",localtime); ' 070903 21:51 Okay. All right. use POSIX qw(strftime); my $date1 = strftime("

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Jeff Pang
try the POSIX::strftime,this use the same datetime format as shell's date command. perl -e ' use POSIX qw/strftime/; print strftime("%y%m%d %H:%M",localtime); ' 070903 21:51 2007/9/3, Shams Fantar <[EMAIL PROTECTED]>: > Hello, > > I want to give a d

Shell qw(mysqldump) and localtime.

2007-09-03 Thread Shams Fantar
Hello, I want to give a date (the year, the day, the hour and the minute) to a file. So, I use localtime function. But I don't understand how to use localtime (after reading the documentation on this function). Can you help me with this function? Next, I want to use a shell command,

Re: calculating time difference with localtime

2007-08-08 Thread Eko Budiharto
Message- > >> From: timbo [mailto:[EMAIL PROTECTED] > >> Sent: Wednesday, August 08, 2007 07:03 > >> To: beginners@perl.org > >> Subject: calculating time difference with localtime > >> > >> Once I calculate the difference between 2 epoch times

Re: calculating time difference with localtime

2007-08-08 Thread Srinivas
rence with localtime Once I calculate the difference between 2 epoch times, is there a way I can convert the difference into a proper time format? For example... $difference = 13452 then convert it to show timedifference = 35 minutes Thanks in advance. Either spin your own or f

RE: calculating time difference with localtime

2007-08-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: timbo [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 08, 2007 07:03 > To: beginners@perl.org > Subject: calculating time difference with localtime > > Once I calculate the difference between 2 epoch times, is there a way > I ca

calculating time difference with localtime

2007-08-08 Thread timbo
Once I calculate the difference between 2 epoch times, is there a way I can convert the difference into a proper time format? For example... $difference = 13452 then convert it to show timedifference = 35 minutes Thanks in advance. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Time::localtime help

2005-05-16 Thread John W. Krahn
Matt Kopeck wrote: Hi, Hello, I have the following code: use strict; use Time::localtime; my $now = localtime; printf("The current date is %04d-%02d-%02d\n", $now->year+1900, ($now->mon)+1, $ now->mday); It outputs the date in such a format: "The current date is 2005-05-16&

RE: Time::localtime help

2005-05-16 Thread Charles K. Clarkson
Matt Kopeck <mailto:[EMAIL PROTECTED]> wrote: : use strict; : : use Time::localtime; : my $now = localtime; : : printf("The current date is %04d-%02d-%02d\n", $now->year+1900, : ($now->mon)+1, $ : now->mday); : : It outputs the date in such a format: "The cur

Re: Time::localtime help

2005-05-16 Thread Peter Rabbitson
> printf("The current date is %04d-%02d-%02d\n", $now->year+1900, > ($now->mon)+1, $ > now->mday); > > It outputs the date in such a format: "The current date is 2005-05-16". > I would like the name of the month(ex. 'May') displayed instead of 05. > What is the easiest way to do this? > The mos

Time::localtime help

2005-05-16 Thread Matt Kopeck
Hi, I have the following code: use strict; use Time::localtime; my $now = localtime; printf("The current date is %04d-%02d-%02d\n", $now->year+1900, ($now->mon)+1, $ now->mday); It outputs the date in such a format: "The current date is 2005-05-16". I would

RE: Why are timelocal() and localtime() not exactly opposite?

2004-06-21 Thread Bob Showalter
Zeus Odin wrote: > ... > # localtime cannot handle year 1903, but timelocal can Short answer is that the epoch started in 1970, so 1903 is "out of range" for the purposes of localtime(). Don't use epoch seconds for storing historical dates like birth dates, etc. -- T

Re: Why are timelocal() and localtime() not exactly opposite?

2004-06-20 Thread Gunnar Hjalmarsson
Zeus Odin wrote: use Time::Local; # localtime cannot handle year 1903, but timelocal can print scalar timelocal(0,0,0, 31, 11, 2003), "\n"; print scalar timelocal(0,0,0, 31, 11, 1903), "\n"; print scalar localtime timelocal(0,0,0, 31, 11, 2003), "\n"; print scalar loc

Why are timelocal() and localtime() not exactly opposite?

2004-06-20 Thread Zeus Odin
Hello, group! It is, like all other days, a great day to be a Perl programmer. Can anyone shed some light on the following? #!/usr/bin/perl use warnings; use strict; use Time::Local; # localtime cannot handle year 1903, but timelocal can print scalar timelocal(0,0,0, 31, 11, 2003), "\n&qu

Re: date format using localtime()

2004-03-12 Thread Owen Cook
On Fri, 12 Mar 2004, Jeff Westman wrote: > Is there a way in perl to get the month/day/year using localtime > WITHOUT using 'use POSIX qw(strftime)' or a system "date" call. > > Something using slices, maybe something like: > > print scalar ((local

Re: date format using localtime()

2004-03-12 Thread Steve Mayer
Jeff, Check out http://www.users.voicenet.com/~corr/macsupt/macperl/localtime.html Steve On Fri, Mar 12, 2004 at 01:38:28PM -0800, Jeff Westman wrote: > Is there a way in perl to get the month/day/year using localtime > WITHOUT using 'use POSIX qw(strftime)' or a sy

date format using localtime()

2004-03-12 Thread Jeff Westman
Is there a way in perl to get the month/day/year using localtime WITHOUT using 'use POSIX qw(strftime)' or a system "date" call. Something using slices, maybe something like: print scalar ((localtime(time))[4,3,7]) expecting the result to be 03122004. Trivial questio

RE: format localtime()

2004-01-21 Thread Bob Showalter
rmck wrote: > I cant get localtime to print in "mm-dd- hh:mm:ss" , I keep > getting it like so "Sun Dec 28 03:35:19 2003" POSIX::strftime gives you complete control over the format. use POSIX 'strftime'; print strftime('%m-%d-%Y %H:%M:%S&#

RE: format localtime()

2004-01-21 Thread Dan Muey
> Hi > > I have the following script that sucks in a file and converts > unix timestamp to human readable.. > > The Goal is to do a search and replace of unix time to the > format i need. But I'm just trying to get it to print in the > format i need first...

format localtime()

2004-01-21 Thread rmck
Hi I have the following script that sucks in a file and converts unix timestamp to human readable.. The Goal is to do a search and replace of unix time to the format i need. But I'm just trying to get it to print in the format i need first... I cant get localtime to print in "

Re: Localtime minutes before or after

2003-08-17 Thread Jeff 'japhy' Pinyan
ous, I'm subtracting one from $mon because Perl starts months at zero, and adding 100 to $year because Perl subtracts 1900 from the year, so 2003 is 103 to Perl. Now, we just add the number of seconds in 5 minutes to $seconds, and use localtime() to get back the new date: my $MINUTES

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, ad

Localtime minutes before or after

2003-08-17 Thread Pablo Fischer
Hi! Im looking for a module (or way) to add N minutes to localtime, for example, I have: 030817145 That localtime returns me: Sun Aug 17 14:05:21 2003 However in some parts of my code I need to get another date, and I only have: 030817145 and that I need the time in 10 minutes before/after

Re: localtime question - zero padding - mnth discrepancy

2002-12-16 Thread John W. Krahn
t sure I understand why it needs to be there. > > cat test2 > > #!/usr/local/bin/perl -w > $now = time; > > $date_spec = ($now - 86400); > # local time adjusted > @lta = localtime($date_spec); The value in $lta[5] is now 102. > $mnth = ($lta[4] +

Re: localtime question - zero padding - mnth discrepancy

2002-12-16 Thread Harry Putnam
bin/perl -w $now = time; $date_spec = ($now - 86400); # local time adjusted @lta = localtime($date_spec); $mnth = ($lta[4] + 1); print " $mnth/$lta[3]/" . ($lta[5] += 1900) . " $lta[2]:$lta[1]:$lta[0]\n"; print localtime() . "\n"; printf " %02d/%

Re: localtime question - zero padding - mnth discrepancy

2002-12-15 Thread John W. Krahn
ke and I'm too blind to see it. >Notice how the month is off by 1 perldoc -f localtime [snip] specified time. $mday is the day of the month, and $mon is the month itself, in the range `0..11' with 0 indicating January and 11 indicating December.

FW: localtime question - zero padding - mnth discrepancy

2002-12-15 Thread Toby Stuart
> -Original Message- > From: Toby Stuart [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 16, 2002 4:17 PM > To: '[EMAIL PROTECTED]' > Subject: RE: localtime question - zero padding - mnth discrepancy > > > > > > -Original Message

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) Ho

localtime question - zero padding - mnth discrepancy

2002-12-15 Thread Harry Putnam
ay = 86400 $date_spec = ($now - 86400); # local time adjusted @lta = localtime($date_spec); # 0=second # 1=minute # 2=hour # 3=day of mnth # 5=year # 4=mnth # 6=day of week print " $lta[4]/$lta[3]/" . ($lta[5] += 1900) . " $lta[2]:$lta[1]:$lta[0]\n&qu

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

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 per

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 mo

localtime

2002-11-22 Thread jonathan . musto
Hi all, 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!?? Any help would be much a

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
onment variable for perl...theoretically you shouldn't have to do this. - Original Message - From: "Goodman Kristi - kgoodm" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 28, 2002 10:38 AM Subject: localtime () > I asked this question about a

Re: localtime ()

2002-10-28 Thread Greg Oliver
found a > solution. > > My localtime () function returns a time that is 5 hours ahead. I am > running Win2000 and Perl 5.6.1 633 (activestate). I have checked my > BIOS time and it is correct and my time function (DOS) is correct. I > have no idea where it is getting this t

Re: localtime ()

2002-10-28 Thread Greg Oliver
TED]> wrote: > I asked this question about a week ago but still have not found a > solution. > > My localtime () function returns a time that is 5 hours ahead. I am > running Win2000 and Perl 5.6.1 633 (activestate). I have checked my > BIOS time and it is correct and my time f

localtime ()

2002-10-28 Thread Goodman Kristi - kgoodm
I asked this question about a week ago but still have not found a solution. My localtime () function returns a time that is 5 hours ahead. I am running Win2000 and Perl 5.6.1 633 (activestate). I have checked my BIOS time and it is correct and my time function (DOS) is correct. I have no idea

Re: Easy one [getting "OCT" from localtime]

2002-10-27 Thread John W. Krahn
Jeff 'Japhy' Pinyan wrote: > > On Oct 27, John W. Krahn said: > > >> So what did "localtime[4]" (without parens) do? > > > >my $x = localtime[4]; > > > >Is the same as: > > > >my $x = localtime; > > > >Which as

Re: Easy one [getting "OCT" from localtime]

2002-10-27 Thread Jeff 'japhy' Pinyan
On Oct 27, John W. Krahn said: >> So what did "localtime[4]" (without parens) do? > >my $x = localtime[4]; > >Is the same as: > >my $x = localtime; > >Which assigns the scalar value of localtime to $x. The [4] part is >ignored. No, it is not ignored.

Re: Easy one [getting "OCT" from localtime]

2002-10-27 Thread John W. Krahn
K Pfeiffer wrote: > > This lost me for a moment. I figured it out by trying... > > #!/usr/bin/perl > use warnings; > use strict; > # test "get uc month from localtime" > > my $month = qw(JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV > DEC)[(localtime)

Re: Easy one [getting "OCT" from localtime]

2002-10-27 Thread K Pfeiffer
John W. Krahn writes: > Jeff 'Japhy' Pinyan wrote: [...] > > my $month = (split ' ', uc localtime)[1]; > > > > localtime(), in scalar context, returns a string like > > > > "Fri Oct 25 10:30:23 2002" > > > > I'm u

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 --

RE: LOCALTIME question

2002-10-22 Thread Goodman Kristi - kgoodm
When I type "time" at the command prompt it is different from localtime. Time: C:\work>time The current time is: 15:28:42.03 localtime: Tue Oct 22 20:29:59 2002 -Original Message- From: [EMAIL PROTECTED] [mailto:shawn_milochik@;godivachoc.com] Sent: Tuesda

RE: LOCALTIME question

2002-10-22 Thread Goodman Kristi - kgoodm
This is the output from a script that outputs the localtime variable and the net time command. LocalTime: Tue Oct 22 20:18:31 2002 Net Time: Current time at \\kgoodm is 10/22/2002 3:18 PM The localtime output is still 5 hours ahead of my net time output. I looked and my time zone is

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

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

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 m

LOCALTIME question

2002-10-22 Thread Goodman Kristi - kgoodm
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? Thanks, Kristi Kristi Goodman Technical Support

Re: A localtime question

2002-07-14 Thread Connie Chan
> my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); > ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); why not combine the 2 line as : my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); > $year+=1900; > $date = $yea

Re: A localtime question

2002-07-13 Thread Steve
at 05:38 PM, Steve wrote: > > I have this snippet of code: > > > > > > use warnings; > > use strict; > > use diagnostics; > > my $date; > > my $base_url; > > my $full_url; > > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); > &

Re: A localtime question

2002-07-13 Thread George Schlossnagle
; > my $date; > my $base_url; > my $full_url; > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); > ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); > $year+=1900; > $date = $year.$mday.$mon; > > $date is getting concatennated with 2002136 and I

A localtime question

2002-07-13 Thread Steve
I have this snippet of code: use warnings; use strict; use diagnostics; my $date; my $base_url; my $full_url; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year+=1900; $date = $year.$mday.$mon; $date is

Re: getting date from localtime

2002-06-25 Thread drieux
On Tuesday, June 25, 2002, at 07:01 , Johnson, Shaunn wrote: > ($mday, $mon, $year) = (localtime())[3 .. 5]; have you thought about the off set values of $wday? my ($mday, $mon, $year,$wday) = (localtime())[3 .. 6]; $year += 1900; my $k_mon = $mon + 1; my @day_oh_week = qw/Sun Mon Tues W

RE: getting date from localtime

2002-06-25 Thread Shishir K. Singh
>Howdy: >I'm trying to do the following (which may have >been created already) in perl: >* create two variables >var1 = this will be sunday of current week always >var2 = this will be saturday of current week always >I'm not sure how I can use 'localtime&

RE: getting date from localtime

2002-06-25 Thread Shishir K. Singh
>Howdy: >I'm trying to do the following (which may have >been created already) in perl: >* create two variables >var1 = this will be sunday of current week always >var2 = this will be saturday of current week always >I'm not sure how I can use 'localtime&

getting date from localtime

2002-06-25 Thread Johnson, Shaunn
Howdy: I'm trying to do the following (which may have been created already) in perl: * create two variables var1 = this will be sunday of current week always var2 = this will be saturday of current week always I'm not sure how I can use 'localtime' as a tool for identifyi

Re: Backing up two days from localtime

2002-04-26 Thread John W. Krahn
Tara Calishain wrote: > > Actually, are there any books/docs that talk specifically about dealing > with time? http://www.rdbooks.com/store/products/rd2735.htm John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

RE: Backing up two days from localtime

2002-04-26 Thread Timothy Johnson
You can convert the date/time to seconds format using the Time::Local module. It attempts to do a "reverse localtime()". -Original Message- From: Felix Geerinckx To: [EMAIL PROTECTED] Sent: 4/26/02 5:40 AM Subject: Re: Backing up two days from localtime on Fri, 26 Apr 200

Re: Backing up two days from localtime

2002-04-26 Thread Michael Lamertz
On Fri, Apr 26, 2002 at 08:32:21AM -0400, Tara Calishain wrote: > I'm anticipating coming across this same problem with user input dates, and > I don't expect the seconds trick will work for that one. > > For example, say a user specified $day-$month-$year and ten days, and I > wanted to generat

Re: Backing up two days from localtime

2002-04-26 Thread Felix Geerinckx
on Fri, 26 Apr 2002 12:32:21 GMT, [EMAIL PROTECTED] (Tara Calishain) wrote: > Actually, are there any books/docs that talk specifically about > dealing with time? > I'm anticipating coming across this same problem with user input > dates, and I don't expect the seconds trick will work for that >

Re: Backing up two days from localtime

2002-04-26 Thread Tara Calishain
At 02:05 AM 4/26/2002, Jeff 'japhy' Pinyan wrote: > >I need to back up two days from localtime and I can't figure out how to do > >it. Currently I'm doing this just so I can work out the rest of the program: > > > >($day, $month, $year) = (localti

Re: Backing up two days from localtime

2002-04-26 Thread Michael Lamertz
On Fri, Apr 26, 2002 at 09:32:04AM +0100, Jonathan E. Paton wrote: > > I need to back up two days from localtime and I can't > > figure out how to do it. Currently I'm doing this just > > so I can work out the rest of the program: > > [Ignore me if you aren&

Re: Backing up two days from localtime

2002-04-26 Thread Jonathan E. Paton
> I need to back up two days from localtime and I can't > figure out how to do it. Currently I'm doing this just > so I can work out the rest of the program: [Ignore me if you aren't on a Unix like platform] Hi, You should seriously consider installing the 'at&#x

RE: Backing up two days from localtime

2002-04-25 Thread Timothy Johnson
Actually this is a really common question. The thing you need to remember is that when you use localtime(), what you are really saying is localtime(time). Local time takes the number of seconds since the year 1970 and translates it into the array you are using UNLESS YOU SPECIFY ANOTHER DATE

Re: Backing up two days from localtime

2002-04-25 Thread Jeff 'japhy' Pinyan
On Apr 26, Tara Calishain said: >I need to back up two days from localtime and I can't figure out how to do >it. Currently I'm doing this just so I can work out the rest of the program: > >($day, $month, $year) = (localtime) [3,4,5]; #getting your local time The gene

Backing up two days from localtime

2002-04-25 Thread Tara Calishain
Howdy, I need to back up two days from localtime and I can't figure out how to do it. Currently I'm doing this just so I can work out the rest of the program: ($day, $month, $year) = (localtime) [3,4,5]; #getting your local time information $realday = $day-2; if ($realday<1) {

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 System

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 P

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 th

localtime help

2002-04-16 Thread James Kelty
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] -- To unsubscribe, e-mail: [EMAIL

RE: perldoc -f localtime: What is (localtime)[8] ??

2002-01-15 Thread Wagner-David
If non zero indicates Daylight Savings Time is in effect. Wags ;) -Original Message- From: Frank Newland [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 15, 2002 09:20 To: [EMAIL PROTECTED] Subject: perldoc -f localtime: What is (localtime)[8] ?? perldoc -f localtime

perldoc -f localtime: What is (localtime)[8] ??

2002-01-15 Thread Frank Newland
perldoc -f localtime returns # 0 12 3 4 5 678 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time); What is $isdst??? Thanks, Frank -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

RE: Scalar Localtime

2001-12-16 Thread Peter Cornelius
= time(); if ($date == $now) { #now } elsif ($date > $now) { #future date } else { #must've already happened } timelocal does the opposite of localtime, returning seconds since the epoch for the localtime style date array. Is this what you were after? Peter C. -Original Message-

Re: Scalar Localtime

2001-12-15 Thread Jonathan E. Paton
> I have a question. Why is it that I have to use 'scalar > localtime' to view a datetime in the proper format. > Why would I want to use the weird UNIX format that I > can't read? You don't, but Perl isn't stupid enough to impliement several dozen ways

Re: Scalar Localtime

2001-12-15 Thread Michael R. Wolf
"Michael Pratt" <[EMAIL PROTECTED]> writes: > I have a question. Why is it that I have to use Scalar localtime to view a > datetime in the proper format. why would I want to use the weird UNIX format > that I cant read? If you want to manipulate the parts separately:

  1   2   >