home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!cs.utexas.edu!convex!convex!tchrist
- From: Tom Christiansen <tchrist@convex.COM>
- Subject: Re: month in localtime?
- Originator: tchrist@pixel.convex.com
- Sender: usenet@news.eng.convex.com (news access account)
- Message-ID: <1993Jan22.135742.648@news.eng.convex.com>
- Date: Fri, 22 Jan 1993 13:57:42 GMT
- Reply-To: tchrist@convex.COM (Tom Christiansen)
- References: <1993Jan20.205428.19963@fnbc.com>
- Nntp-Posting-Host: pixel.convex.com
- Organization: Convex Computer Corporation, Colorado Springs, CO
- Keywords: time,month
- X-Disclaimer: This message was written by a user at CONVEX Computer
- Corp. The opinions expressed are those of the user and
- not necessarily those of CONVEX.
- Lines: 26
-
- From the keyboard of jja@fnbc.com (Joseph Alotta):
- :how does one get the month out in localtime?
- :this one's right out of the book:
- :
- :#!/usr/local/bin/perl
- :($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
- :print "$sec,$min,$hour,$mday,mon=$mon,$year,$wday,$yday,$isdst\n";
- :exit;
- :
- :amy{jja}44: headline.prl
- :19,52,14,20,mon=0,93,3,19,0
- :amy{jja}45: date
- :Wed Jan 20 14:52:21 CST 1993
-
-
- # I make both 0 and 7 be Sunday cause some folks are confused
- $wname = (Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun)[$wday];
-
- $mname = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$mon];
-
- --tom
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
- "...this does not mean that some of us should not want, in a rather
- dispassionate sort of way, to put a bullet through csh's head."
- Larry Wall in <1992Aug6.221512.5963@netlabs.com>
-