[12642] in Perl-Users-Digest
Perl-Users Digest, Issue: 51 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 7 09:47:27 1999
Date: Wed, 7 Jul 1999 06:37:33 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 7 Jul 1999 Volume: 9 Number: 51
Today's topics:
Re: time question (Chris Thompson)
Re: time question <Webdesigner@NewWebSite.com>
Re: time question (Graham Ashton)
Re: time question (Andrew Johnson)
Re: time question <aperrin@mcmahon.qal.berkeley.edu>
Re: time question <sjs@yorku.ca>
Re: time question (elephant)
Re: time question <gellyfish@gellyfish.com>
Re: time question <uri@sysarch.com>
Re: time question (elephant)
Re: time question <uri@sysarch.com>
time() - I've RTFM and it gave me no !@#$ answers! <ally@netspace.net.au>
Re: time() - I've RTFM and it gave me no !@#$ answers! <swiftkid@bigfoot.com>
Re: time() - I've RTFM and it gave me no !@#$ answers! <gellyfish@gellyfish.com>
Re: time() - I've RTFM and it gave me no !@#$ answers! (brian d foy)
Re: time() - I've RTFM and it gave me no !@#$ answers! (elephant)
Re: time() - I've RTFM and it gave me no !@#$ answers! (elephant)
Re: time() - I've RTFM and it gave me no !@#$ answers! (Larry Rosler)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 4 Jul 1999 23:27:42 GMT
From: nospam@nospam.nospam (Chris Thompson)
Subject: Re: time question
Message-Id: <7loqle$qno$1@pegasus.csx.cam.ac.uk>
In article <MPG.11d9b7a4b52d3877989c28@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <7kp27v$99k$1@coranto.ucs.mun.ca> on 22 Jun 1999 22:20:47
>GMT, Paul David Fardy <pdf@morgan.ucs.mun.ca> says...
[...snip snip...]
>>
>> Actually, time() gives me the number of seconds since 1969-12-31.
>
>Wrong. It is the number of seconds since 1970-01-01 00:00:00 UTC,
>taking no account of leap seconds (which means it is actually the number
>of seconds since about 1970-01-01 00:00:29 TIA, but let's not get too
>far into that now :-).
But why not? Because you can't justify that 29 seconds, not nohow, eh? :-)
The charitable interpretation is that you've been asleep in a cave for the
last 5 years and have missed the last 3 leap seconds. TAI-UTC has been 32
seconds since 1999-01-01 00:00:00 UTC.
And that *is* TAI (Temps Atomique International) by the way, not TIA, which
stands for "Thanks In Advance" :-)
Chris Thompson
Email: cet1 [at] cam.ac.uk
------------------------------
Date: Mon, 05 Jul 1999 01:39:57 GMT
From: Floyd Morrissette <Webdesigner@NewWebSite.com>
Subject: Re: time question
Message-Id: <7lp2dd$7nl$1@nnrp1.deja.com>
Has it occured to anybody that not all of have access to the perl docs.
So of don't have telnet access to our host systems and we are not
running our own server. That is why we come to the newsgroup - to ask
questions. If we all had the docs then we probably would not have any
questions. If you don't know the answer then don't post anything. Don't
just say go read the instructions. It is my opinion that the ones who
say "read the docs" don't know the answer and just want to have an
excuse to post something.
In article <376ecd8d.1851572@news.demon.co.uk>,
dave@dave.org.uk (Dave Cross) wrote:
> On 20 Jun 1999 09:38:25 GMT, jimtaylor5@aol.com (Jimtaylor5) wrote:
>
> >I hope this is not really a dumb question, but I've been trying to
figure out
> >how to get seconds from localtime (or anywhere) to calculate how long
a task
> >takes. How would I get the time in seconds from Perl, in order to say
this task
> >to 11 seconds or whatever it took. I know how to calculate it, jut
not how to
> >get the time in seconds. Can anyone help?
>
> It's only a dumb question because the answer is sitting on whatever
> computer you run Perl on. The free docs that come with Perl are one of
> the best sets of documentation that you'll find for any programming
> language. If you didn't find the answer to your question by searching
> the docs for 'time' or 'seconds', I'd be genuinely interested to know
> exactly what could be done to make it any easier for you.
>
> hth,
>
> Dave...
>
> p.s. perldoc -f time
>
> --
> Dave Cross <dave@dave.org.uk>
> <http://www.dave.org.uk>
>
--
Get your web site from http://www.NewWebSite.com
Consultation is always free.
Help with cgi scripts.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 5 Jul 1999 02:32:28 GMT
From: billynospam@mirror.bt.co.uk (Graham Ashton)
Subject: Re: time question
Message-Id: <slrn7o069t.tjt.billynospam@wing.mirror.bt.co.uk>
In article <7lp2dd$7nl$1@nnrp1.deja.com>, Floyd Morrissette wrote:
>Has it occured to anybody that not all of have access to the perl docs.
no, it hasn't. has it occurred to you that it's all available on the
Internet?
http://language.perl.com/info/documentation.html
and if you think that's hard to find, guess which page you get if you
type "perl documentation" into www.google.com, and hit the "I'm feeling
lucky" button ...
--
Graham
P.S. <billynospam@mirror.bt.co.uk> is a fully working address...
------------------------------
Date: Mon, 05 Jul 1999 03:54:36 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: time question
Message-Id: <00Wf3.4239$SH6.87352@news1.rdc2.on.home.com>
In article <7lp2dd$7nl$1@nnrp1.deja.com>,
Floyd Morrissette <Webdesigner@NewWebSite.com> wrote:
! Has it occured to anybody that not all of have access to the perl docs.
No ... the docs are about as accessible as humanly possible:
a) They come with the perl distribution ... which you can
obtain and install on your own system
b) They are available online at www.perl.com, and you can download
the whole HTML tree, a postscript version, or a text version of
the documentation from there as well.
c) the FAQ's and perlfunc entries are now regularly posted (one at a
time) to this newsgroup ... you can find those with a usenet
archive search such as dejanews
! So of don't have telnet access to our host systems and we are not
! running our own server.
Given the above, this is no excuse for not having access to the
documentation. Running a server has nothing to do with accessing
the documentation.
! just say go read the instructions. It is my opinion that the ones who
! say "read the docs" don't know the answer and just want to have an
! excuse to post something.
It is my opinion that people of your opinion:
a) are too opinionated,
b) just want to have an excuse to post something,
c) are simply wrong.
andrew
------------------------------
Date: Sun, 04 Jul 1999 21:25:11 -0700
From: Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: time question
Message-Id: <378033A7.60BD6A52@mcmahon.qal.berkeley.edu>
Floyd Morrissette wrote:
> So of don't have telnet access to our host systems and we are not
> running our own server.
1.) Switch servers.2.) http://language.perl.com/info/documentation.html
> It is my opinion that the ones who
> say "read the docs" don't know the answer and just want to have an
> excuse to post something.
You're wrong. The ones who say "read the docs" are tired of answering the
same questions 30 times a day.
--
-------------------------------------------------------------
Andrew Perrin - NT/Unix/Access Consulting - aperrin@mcmahon.qal.berkeley.edu
http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------
------------------------------
Date: Mon, 5 Jul 1999 00:32:08 -0400
From: Steven Smolinski <sjs@yorku.ca>
Subject: Re: time question
Message-Id: <931149400.805354363@newshub.ccs.yorku.ca>
On Sun, 04 Jul 1999, Floyd Morrissette wrote:
>Has it occured to anybody that not all of have access to the perl docs.
Technically speaking, if you can post to usenet, then you have *access* to the
docs.
And I have found the various O'Reilly books a better resource than the docs,
in any case (mostly because they are good subway reading).
In fact, I often find the answer to my problem when formatting my post to
usenet to ask about it; in an effort to check everywhere I know of *before* I
post, I usually run across the answer to my problem, and discard the post
before it is sent. I like figuring things out for myself muvh better than
hoping for answers anyway...
Steve
------------------------------
Date: Mon, 5 Jul 1999 15:22:44 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: time question
Message-Id: <MPG.11eaec31b0e2a5be989ae4@news-server>
Steven Smolinski writes ..
>Technically speaking, if you can post to usenet, then you have *access* to the
>docs.
technically speaking ? .. you mean the docs reside somewhere on port 119
?
--
jason - remove all hyphens for email reply -
------------------------------
Date: 5 Jul 1999 20:27:08 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: time question
Message-Id: <7lr4es$5c0$1@gellyfish.btinternet.com>
On Mon, 05 Jul 1999 01:39:57 GMT Floyd Morrissette wrote:
> It is my opinion that the ones who
> say "read the docs" don't know the answer and just want to have an
> excuse to post something.
Of course you are entitled to your opinion. But how do you suggest
that people know the answers are in the docs in the first place if
they dont know what the answers are ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 05 Jul 1999 18:17:45 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: time question
Message-Id: <x7vhbywxkm.fsf@home.sysarch.com>
>>>>> "JS" == Jonathan Stowe <gellyfish@gellyfish.com> writes:
JS> On Mon, 05 Jul 1999 01:39:57 GMT Floyd Morrissette wrote:
>> It is my opinion that the ones who
>> say "read the docs" don't know the answer and just want to have an
>> excuse to post something.
JS> Of course you are entitled to your opinion. But how do you suggest
JS> that people know the answers are in the docs in the first place if
JS> they dont know what the answers are ...
because we don't read the docs. we know all!! we don't fish, the fish
jump into our frying pans. we don't hunt, the animals commit suicide for
us.
so our saying RTFM means, just ask the animals and fish to help you out,
like they help us out.
:-)
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Tue, 6 Jul 1999 09:10:19 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: time question
Message-Id: <MPG.11ebe664ff25ca7f989afc@news-server>
Uri Guttman writes ..
>because we don't read the docs. we know all!! we don't fish, the fish
>jump into our frying pans. we don't hunt, the animals commit suicide for
>us.
interesting that you bring this nature aspect into the foray Uri ..
whenever I see one of these newbies posting another "I'm lying on my back
now guys and SOMEONE's GONNA HAVE TO HELP flip me over." style of
questions I picture what might be the eqivalent in the animal kingdom
imagine for a second .. out on the tundra .. with a pride of lions lying
in wait for passing game .. saliva dripping from their jaws .. and as
some young Gazelle's spring into view - the perfect opportunity presents
itself to the waiting lions .. but these lions are from the Newbie pride
so instead of pouncing on the waiting game and having themselves a meal
they all look away - pretending not to notice the Gazelle's .. and they
complain .. (in a high whiney voice) - "The Gazelle's are too faaasst."
--
jason - remove all hyphens for email reply -
------------------------------
Date: 05 Jul 1999 23:21:17 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: time question
Message-Id: <x7emimwjiq.fsf@home.sysarch.com>
>>>>> "e" == elephant <e-lephant@b-igpond.com> writes:
e> Uri Guttman writes ..
>> because we don't read the docs. we know all!! we don't fish, the fish
>> jump into our frying pans. we don't hunt, the animals commit suicide for
>> us.
e> interesting that you bring this nature aspect into the foray Uri ..
e> whenever I see one of these newbies posting another "I'm lying on my back
e> now guys and SOMEONE's GONNA HAVE TO HELP flip me over." style of
e> questions I picture what might be the eqivalent in the animal kingdom
e> imagine for a second .. out on the tundra .. with a pride of lions lying
e> in wait for passing game .. saliva dripping from their jaws .. and as
e> some young Gazelle's spring into view - the perfect opportunity presents
e> itself to the waiting lions .. but these lions are from the Newbie pride
e> so instead of pouncing on the waiting game and having themselves a meal
e> they all look away - pretending not to notice the Gazelle's .. and they
e> complain .. (in a high whiney voice) - "The Gazelle's are too faaasst."
actually i derived it from the famous give a fish or teach how to fish
parable that has floated around here many times. my sarcastic intent was
to claim, we don't even fish anymore, the fish jump out for us to
enjoy. i bet abigail, tom c, randal, (i know i do), and other gurus,
reread the docs or books or whatever as needed. i don't remember all the
arguments of every perl function and op. but i know how to look them up
when i need to!! so the fish really don't jump, i have to fish, but i
don't ask for free fish either. i may ask how to land a large game fish
or how to cast a dry fly, but i can do like tom sawyer and drop a baited
hook in the water just fine.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Sun, 04 Jul 1999 16:16:56 +1000
From: "Ally Akbarzadeh" <ally@netspace.net.au>
Subject: time() - I've RTFM and it gave me no !@#$ answers!
Message-Id: <7lmu3d$16c7$1@otis.netspace.net.au>
G'day all,
I (like everybody else it seems) am having trouble with dates.
In short what I want to do is convert a date and time (eg 1/2/1999 12:34:32)
into the number of seconds after the system epoch. ie, exactly what time()
does but for a date that *I* specify, not the current time.
Does time() allow any arguments to passed to it, and if so, what format must
they be in?
BTW: If you're wondering why I don't use a module (such as Date::Manip), I'm
a desparately trying to avoid them...
___________________________________
Ally Akbarzadeh
ally@netspace.net.au
------------------------------
Date: Sun, 4 Jul 1999 11:21:54 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: time() - I've RTFM and it gave me no !@#$ answers!
Message-Id: <7lo1rd$asd3@news.cyber.net.pk>
> In short what I want to do is convert a date and time (eg 1/2/1999
12:34:32)
> into the number of seconds after the system epoch. ie, exactly what time()
> does but for a date that *I* specify, not the current time.
>
> Does time() allow any arguments to passed to it, and if so, what format
must
> they be in?
use Date::Parse;
print str2time ( "1/2/1999 12:34:32" );
(P.S. Its a single module, you could copy the file into your tree, or
perhaps
embed the routines in your program)
------------------------------
Date: 4 Jul 1999 12:39:59 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: time() - I've RTFM and it gave me no !@#$ answers!
Message-Id: <7lnkmv$3p7$1@gellyfish.btinternet.com>
On Sun, 04 Jul 1999 16:16:56 +1000 Ally Akbarzadeh wrote:
>
> BTW: If you're wondering why I don't use a module (such as Date::Manip), I'm
> a desparately trying to avoid them...
>
Could we ask why ? You might want to look at chapter 5 of 'Programming Perl'
for reasons why this attitude might be considered wrong in the Perl
mindset.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 04 Jul 1999 16:34:59 -0400
From: brian@pm.org (brian d foy)
Subject: Re: time() - I've RTFM and it gave me no !@#$ answers!
Message-Id: <brian-ya02408000R0407991634590001@news.panix.com>
In article <7lmu3d$16c7$1@otis.netspace.net.au>, "Ally Akbarzadeh" <ally@netspace.net.au> posted:
> BTW: If you're wondering why I don't use a module (such as Date::Manip), I'm
> a desparately trying to avoid them...
then you are just going to have to recreate all that work yourself
rather than doing something more interesting and productive. it's
your time() i guess. ;)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Mon, 5 Jul 1999 09:15:57 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: time() - I've RTFM and it gave me no !@#$ answers!
Message-Id: <MPG.11ea96346123cd6c989add@news-server>
Ally Akbarzadeh writes ..
>Does time() allow any arguments to passed to it, and if so, what format must
>they be in?
yes it takes a string argument .. it's a UTC date format .. it's a pain
in the butt. to generate these yourself though .. so good luck (btw ..
UTC is in the form of "Tue, 22-11-1970 22:54:52 GMT" .. really easy to
generate with POSIX::strftime .. but then you don't want to use ANY
modules (btw .. Tue here was a 1 in 7 guess .. so is probably wrong)
--
jason - remove all hyphens for email reply -
------------------------------
Date: Mon, 5 Jul 1999 12:35:45 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: time() - I've RTFM and it gave me no !@#$ answers!
Message-Id: <MPG.11eac5119b2d3c4e989ae0@news-server>
elephant writes ..
>Ally Akbarzadeh writes ..
>>Does time() allow any arguments to passed to it, and if so, what format must
>>they be in?
>
>yes it takes a string argument .. it's a UTC date format .. it's a pain
>in the butt. to generate these yourself though .. so good luck (btw ..
>UTC is in the form of "Tue, 22-11-1970 22:54:52 GMT" .. really easy to
>generate with POSIX::strftime .. but then you don't want to use ANY
>modules (btw .. Tue here was a 1 in 7 guess .. so is probably wrong)
actually .. I was thinking of something else when I wrote that .. you
should check out the POSIX function mktime() .. to get the epoch seconds
value for (say) midnight on 10th June 1992 you would do the following
#--begin
use POSIX qw(mktime);
$numSeconds = mktime(0,0,0,10,5,92);
#--end
you can then pass the result of the mktime into localtime() .. just as
you would do with the result of time()
--
jason - remove all hyphens for email reply -
------------------------------
Date: Tue, 6 Jul 1999 11:15:07 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: time() - I've RTFM and it gave me no !@#$ answers!
Message-Id: <MPG.11ebe76c7a79ba32989c65@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <7lmu3d$16c7$1@otis.netspace.net.au> on Sun, 04 Jul 1999
16:16:56 +1000, Ally Akbarzadeh <ally@netspace.net.au> says...
...
> In short what I want to do is convert a date and time (eg 1/2/1999 12:34:32)
> into the number of seconds after the system epoch. ie, exactly what time()
> does but for a date that *I* specify, not the current time.
>
> Does time() allow any arguments to passed to it, and if so, what format must
> they be in?
>
> BTW: If you're wondering why I don't use a module (such as Date::Manip), I'm
> a desparately trying to avoid them...
As you already have the components of the date/time readily available,
the easiest approch is to use the function timelocal() or timegm() in
the module Time::Local, which is part of the standard Perl distribution.
But if you are truly pathologically opposed to using modules, you could
cut-and-paste a function that I posted in the Perl Function Repository:
http://moiraine.dimensional.com/~dgris/cgi-
bin/pfr?func=UTC_to_Epoch&type=exact
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 51
************************************