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
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
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
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
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
> 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
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
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
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
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
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();
>
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
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
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
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
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",
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
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 +
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
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
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
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
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("
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
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,
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
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
> -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
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
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&
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
> 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
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
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
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
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
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
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
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
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
> 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...
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 "
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
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
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
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] +
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/%
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.
> -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
> -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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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)
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
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
--
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
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
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
> 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
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
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
> 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
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);
> &
;
> 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
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
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
>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&
>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&
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
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
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
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
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
>
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
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&
> 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
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
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
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) {
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
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
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
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
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 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
= 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-
> 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
"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 - 100 of 112 matches
Mail list logo