Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Perl - Was unix time conversion function

RE: Perl - Was unix time conversion function

From: Alex <axs_at_m-net.arbornet.org>
Date: Tue, 28 Jan 2003 06:19:15 -0800
Message-ID: <F001.0053C038.20030128061915@fatcity.com>


Perl is great for getting the job done fast. It's harder to write a large maintainable system in perl than other languages but you use the right tool for the job. And, IMO, if you are ever writing fancy or real creative code rewrite it. K.I.S.S.

On Tue, 28 Jan 2003, April Wells wrote:

>
> Personally... I think that if I had the same teacher to help me through Perl
> that REALLY taught me what C was doing in memory and got me to REALLY
> understand the power and elegance of pointers, I would code more in Perl. I
> can, and occasionally do, code in Perl, but nothing fancy or real creative.
>
>
> ajw
>
> April Wells
> Oracle DBA
> Great spirits have always encountered violent opposition from mediocre minds
> -- Albert Einstein
>
>
>
> -----Original Message-----
> Sent: Tuesday, January 28, 2003 4:59 AM
> To: Multiple recipients of list ORACLE-L
>
>
> I've managed to successfully avoid learning Perl for a while now... my
> reaction, while not quite so dramatic as yours, was that it made my
> head hurt to try to understand it! :)
>
>
> --- Robert Freeman <robertgfreeman_at_YAHOO.COM> wrote:
> > unix time conversion functionCary.... I once thought I wanted to do
> > some
> > Perl coding... So I bought a book and started to play with it. It
> > made my
> > head bleed... literally I had little droplets of blood emerging from
> > my
> > head.... They rushed me to the hospital and put me in the Perl ward
> > where I
> > languished for days on IV's of Mountain Dew and pulverized Ritz
> > crackers..... it was close.
> >
> > In my mind there is nothing obvious about Perl, this coming from and
> > old C
> > coder who did pointers and linked lists in his sleep years ago. I
> > don't
> > know, maybe I was having a bad day and it's time to get my "learning
> > Perl"
> > book out again....
> >
> > Anyone else feel that way about Perl or am I a lone wolf in a Perl
> > world?
> >
> > RF
> > -----Original Message-----
> > From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of Cary
> > Millsap
> > Sent: Friday, January 24, 2003 4:29 PM
> > To: Multiple recipients of list ORACLE-L
> > Subject: RE: unix time conversion function
> >
> >
> > At the risk of stating the obvious, doing it in Perl looks like
> > this:
> >
> >
> >
> > #!/usr/bin/perl
> >
> > use Date::Format qw(time2str);
> >
> > my $t = 1043447100; # for example
> >
> > print time2str("%T %A %d %B %Y", $t), "\n";
> >
> >
> >
> > Cary Millsap
> > Hotsos Enterprises, Ltd.
> > http://www.hotsos.com
> >
> > Upcoming events:
> > - 2003 Hotsos Symposium on OracleR System Performance, Feb 9-12
> > Dallas
> > - RMOUG Training Days 2003, Mar 5-6 Denver
> > - Hotsos Clinic 101, Mar 26-28 London
> >
> > -----Original Message-----
> > From: root_at_fatcity.com [mailto:root_at_fatcity.com] On Behalf Of Post,
> > Ethan
> > Sent: Friday, January 24, 2003 3:30 PM
> > To: Multiple recipients of list ORACLE-L
> > Subject: RE: unix time conversion function
> >
> >
> >
> > Kinda...you can change the year to 1970 if you want, this also
> > converts to
> > minutes, not seconds. It is a really ugly function but it seems to
> > work.
> > You could always use perl.
> >
> >
> >
> > function f_minutes {
> > # Funky function I use to calculate the number of minutes since
> > 2000
> > MIN_YEAR=$( date +"%Y" )
> > MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
> > MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
> > MIN_DAYS=$( date +"%j" )
> > MIN_DAYS=$( expr "${MIN_DAYS}" - 1 )
> > MIN_DAYS=$( expr "${MIN_DAYS}" \* 1440 )
> > MIN_HOURS=$( date +"%H" )
> > MIN_HOURS=$( expr "${MIN_HOURS}" \* 60 )
> > MIN_MINS=$( date +"%M" )
> > MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} +
> > ${MIN_MINS} ))
> > print ${MIN_TOTAL}
> > }
> >
> > -----Original Message-----
> > From: Adams, Matthew (GECP, MABG, 088130)
> > [mailto:MATT.ADAMS_at_APPL.GE.COM]
> > Sent: Friday, January 24, 2003 1:14 PM
> > To: Multiple recipients of list ORACLE-L
> > Subject: unix time conversion function
> >
> > Anybody got a handy little function to
> > convert a standard unix seconds-since-Jan-1970 epoch
> > time (stored as a number) to a readable date?
> >
> > It would save me a lot of time not having to re-invent the
> > wheel.
> >
> > Matt
> >
> > ----
> > Matt Adams - GE Appliances - matt.adams_at_appl.ge.com
> > My computer beat me at chess, but I won
> > when it came to kick boxing.
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Rachel Carmichael
> INET: wisernet100_at_yahoo.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
>
>
> The information contained in this communication,
> including attachments, is strictly confidential
> and for the intended use of the addressee only;
> it may also contain proprietary, price sensitive,
> or legally privileged information. Notice is
> hereby given that any disclosure, distribution,
> dissemination, use, or copying of the information
> by anyone other than the intended recipient is
> strictly prohibited and may be illegal. If you
> have received this communication in error, please
> notify the sender immediately by reply e-mail, delete
> this communication, and destroy all copies.
>
>
> Corporate Systems, Inc. has taken reasonable precautions
> to ensure that any attachment to this e-mail has been
> swept for viruses. We specifically disclaim all liability
> and will accept no responsibility for any damage sustained
> as a result of software viruses and advise you to carry out
> your own virus checks before opening any attachment.
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: April Wells
> INET: awells_at_csedge.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Alex
  INET: axs_at_m-net.arbornet.org

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Jan 28 2003 - 08:19:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US