Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sepdate

63 views
Skip to first unread message

Rich Holmes

unread,
May 31, 1996, 3:00:00 AM5/31/96
to

A Perl utility of possible interest to a.f.w readers.

#!/bin/perl

# sepdate utility
# usage: sepdate [month date year]
# where day month year are date of interest -- default is today
# e.g. sepdate 10 21 95
# for October 21, 1995
#
# Prints the date in same format as Unix date command (default)
# but unlike the buggy date command this script does take into account the
# fact that September 1993 never ended.
# Known bugs and odd features:
# - if date other than today is specified, time is displayed as 00:00:00.
# - arguments are not checked other than to see if there are 3 or none.
# - dates prior to 9 1 93 are rendered as nonpositive dates in Sept. 1993.

require "timelocal.pl";

if ($#ARGV == 2) {
$thetime = &timelocal(0,0,0,$ARGV[1],$ARGV[0]-1,$ARGV[2])
}
elsif ($#ARGV == -1) {
$thetime = time
}
else {
die 'usage: sepdate [month date year]'
}

$days = int (($thetime - &timelocal(0,0,0,31,7,93)) / (60 * 60 * 24));
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($thetime);

printf ("%3s Sep %2d %2.2d:%2.2d:%2.2d %3s 1993\n", (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],$days,$hour,$min,$sec,(EST,EDT)[$isdst]);


--
*/\/\/\/\/\* fnord. *"I..." - N. Peart* * o=|=====> / * VR O INGSI! *
?| |? O ! O ? "SometimesWithA ? * * ?K#:1 // ? _ \ _ _/-_|\ ?
*| |*O !O *QuoteFromMe"- him* * * \\ // * (_)/ (_) | | ?
?| O O |? O! O?|<||3() |S G()|)!? WPI 77 ? \X/-'-,-@ PERTH-->*_-__/ ?

Sven Guckes

unread,
Jun 2, 1996, 3:00:00 AM6/2/96
to

rsho...@hydra.syr.EDU (Rich Holmes):

> $days = int (($thetime - &timelocal(0,0,0,31,7,93)) / (60 * 60 * 24));

"31,7,93"? What about the August before?
Shouldn't this be "31,8,93"?
Anyway, with "31,8,93" you get:

$ sepdate 6 28 96
Fri Sep 1000 00:00:00 EDT 1993

Sven ["Did I hear someone say PARTY?"]

--
June 28 1996
alt.fan.warlord September Party


Rich Holmes

unread,
Jun 3, 1996, 3:00:00 AM6/3/96
to

>rsho...@hydra.syr.EDU (Rich Holmes):
>> $days = int (($thetime - &timelocal(0,0,0,31,7,93)) / (60 * 60 * 24));
>
>"31,7,93"? What about the August before?
> Shouldn't this be "31,8,93"?

"All array elements are numeric, and come straight out of a struct tm.
(That's a bit of C programming lingo -- don't worry about it.) In
particular this means that $mon has the range 0..11 and $wday has the
range 0..6. (You can remember which ones are 0-based because those
are the ones you're always using as subscripts into 0-based arrays
containing month and day names.)"

>Anyway, with "31,8,93" you get:
>
>$ sepdate 6 28 96
>Fri Sep 1000 00:00:00 EDT 1993

And you also get:

% sepdate 9 1 93
Wed Sep -30 00:00:00 EDT 1993

>Sven ["Did I hear someone say PARTY?"]

No, you heard someone say "LTWP,YPW!"

Bryce Utting

unread,
Aug 13, 2004, 7:34:17 AM8/13/04
to
Rich Holmes (rsho...@hydra.syr.EDU) wrote on 1996/05/31:

> A Perl utility of possible interest to a.f.w readers.

*wimper*

: [zoyd] butting$ sepdate
: Fri Sep 4000 23:30:22 EST 1993
: [zoyd] butting$ sepdate 5 31 1996
: Fri Sep 1004 00:00:00 EST 1993

HappyNet NOW, dammit.


butting (and a very happy 4000th to all of y'all now, 'k?)

David DeLaney

unread,
Aug 13, 2004, 8:38:40 AM8/13/04
to
Bryce Utting <but...@ihug.co.nz> wrote:
>Rich Holmes (rsho...@hydra.syr.EDU) wrote on 1996/05/31:
>> A Perl utility of possible interest to a.f.w readers.
>
>*wimper*

-wimpest-

>: [zoyd] butting$ sepdate
>: Fri Sep 4000 23:30:22 EST 1993
>: [zoyd] butting$ sepdate 5 31 1996
>: Fri Sep 1004 00:00:00 EST 1993
>
>HappyNet NOW, dammit.

You're soaking in it!

>butting (and a very happy 4000th to all of y'all now, 'k?)

Dave "and many happy RETURNs" DeLaney
--
\/David DeLaney posting from d...@vic.com "It's not the pot that grows the flower
It's not the clock that slows the hour The definition's plain for anyone to see
Love is all it takes to make a family" - R&P. VISUALIZE HAPPYNET VRbeable<BLINK>
http://www.vic.com/~dbd/ - net.legends FAQ & Magic / I WUV you in all CAPS! --K.

TimC

unread,
Aug 13, 2004, 8:24:08 AM8/13/04
to
On Fri, 13 Aug 2004 at 11:34 GMT, Bryce Utting (aka Bruce)
was almost, but not quite, entirely unlike tea:

I calibrated my celebration by having a bit of cheap but good Pinot
Noir and Indian. Mmm. What's that saying about Mango Sorbet?

Also: I am ashamed to admit that I have been counting down every day
since Tue Sep 3990 10:05:02 EST 1993, but missed
Fri Sep 4000 22:17:07 EST 1993.

Also Also: I be demanding to know why you are too on the EST
timezone. Damn you all who live in Eastern XXXX.

--
TimC -- http://astronomy.swin.edu.au/staff/tconnors/
"Mango sorbet is clearcut proof that we have progressed beyond the
bare needs of survival and have progressed to the transcendant."
- Marc Goodman in talk.bizarre

Rich Holmes

unread,
Aug 13, 2004, 8:46:08 AM8/13/04
to
TimC <tcon...@no.astro.spam.swin.accepted.edu.here.au> writes:

> Also Also: I be demanding to know why you are too on the EST
> timezone. Damn you all who live in Eastern XXXX.

Hmm, I dunno why I didn't list in the 'bugs' comments the fact that
sepdate assumes your time zone is either EST, if you're not on
daylight savings time, or EDT, if you are.

--
*/\/\/\/\/\* fnord. *"I..." - N. Peart* * o=|=====> / * VR O X-warlord:no*


?| |? O ! O ? "SometimesWithA ? * * ?K#:1 // ? _ \ _ _/-_|\ ?
*| |*O !O *QuoteFromMe"- him* * * \\ // * (_)/ (_) | | ?

?| O O |? O! O?|<||3() |S G()|)!? WPI 77 ? \X/-'-,-@ INGSI! *_-__/ ?

TimC

unread,
Aug 13, 2004, 9:36:59 AM8/13/04
to
On Fri, 13 Aug 2004 at 12:46 GMT, Rich Holmes (aka Bruce)

was almost, but not quite, entirely unlike tea:
> TimC <tcon...@no.astro.spam.swin.accepted.edu.here.au> writes:
>
>> Also Also: I be demanding to know why you are too on the EST
>> timezone. Damn you all who live in Eastern XXXX.
>
> Hmm, I dunno why I didn't list in the 'bugs' comments the fact that
> sepdate assumes your time zone is either EST, if you're not on
> daylight savings time, or EDT, if you are.

Ahhh:

It seems my endlessseptember.1 (endlessseptember is a ruby script, but
I don't have ruby installed:
#!/usr/bin/env ruby

require 'date'
print Time.now.strftime "%a Sep #{Date.today-Date.new(1993,8,31)} %H:%M:%S %Z 1993"
print "\n"
)

came from you originally, and then made it half way around UNSENET via
rec.humor.oracle.d with a vital change:

#!/usr/bin/perl

# Adapted and updated from a version attributed to Rich Holmes

use Time::Local;
use POSIX qw(strftime);

if ($#ARGV == 2) {
$todmon = $ARGV[0]-1;
$todday = $ARGV[1];
$todyr = $ARGV[2];
$todti = timelocal(0, 0, 0, $todday, $todmon, $todyr);
} elsif ($#ARGV == -1) {
$todti = time;
} else {
die;
}

$septime = timelocal(0, 0, 0, 31, 7, 93);

$tdiff = $todti - $septime;
$days = int ($tdiff / (60 * 60 * 24));

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

# this seems like overkill
$tzstr = strftime("%Z", $sec, $min, $hour, $mday, $mon, $year);


printf ("%3s Sep %2d %2.2d:%2.2d:%2.2d %3s 1993\n",
(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],

$days,$hour,$min,$sec,$tzstr);


Yay! For $tzstr!

Bus error -- driver executed.

Adam Thornton

unread,
Aug 13, 2004, 2:08:29 PM8/13/04
to
In article <slrn-0.9.7.4-25062-2...@hexane.ssi.swin.edu.au>,

TimC <tcon...@no.astro.spam.swin.accepted.edu.here.au> wrote:
>Also Also: I be demanding to know why you are too on the EST
>timezone. Damn you all who live in Eastern XXXX.

Welcome to the Eastern Standard Tribe.

Adam

Dr. Otto Bahn

unread,
Aug 13, 2004, 3:05:21 PM8/13/04
to
"Adam Thornton" <ad...@fsf.net> wrote:

> >Also Also: I be demanding to know why you are too on the EST
> >timezone. Damn you all who live in Eastern XXXX.
>
> Welcome to the Eastern Standard Tribe.

The pr0n industry wakes up at 7 A.M. EST. It takes
about three hours to go fwap-fwap-fwap all the way
to Cali-forn-i-a.

Rinse, lubricate, repeat.

--oTTo--

If you want to get laid, don't masturbate


Nick Leverton

unread,
Aug 13, 2004, 3:34:40 PM8/13/04
to
In article <u4r7qbx...@mep1.phy.syr.edu>,

Rich Holmes <rsholme...@mailbox.syr.edu> wrote:
>TimC <tcon...@no.astro.spam.swin.accepted.edu.here.au> writes:
>
>> Also Also: I be demanding to know why you are too on the EST
>> timezone. Damn you all who live in Eastern XXXX.
>
>Hmm, I dunno why I didn't list in the 'bugs' comments the fact that
>sepdate assumes your time zone is either EST, if you're not on
>daylight savings time, or EDT, if you are.

Here's a patch to your original:

--- sepdate.pl.orig 1996-05-31 16:43:22.000000000 +0100
+++ sepdate.pl 2004-08-13 20:31:29.000000000 +0100
@@ -44,7 +44,7 @@
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($thetime);



printf ("%3s Sep %2d %2.2d:%2.2d:%2.2d %3s 1993\n",

-(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],$days,$hour,$min,$sec,(EST,EDT)[$isdst]);
+(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],$days,$hour,$min,$sec,strftime('%Z',localtime));


# --

Nick
--
"And we will be restoring neurotypicality just as soon as we are sure
what is normal anyway. Thank you". -- not quite DNA

Rich Holmes

unread,
Aug 13, 2004, 3:51:26 PM8/13/04
to
ni...@leverton.org (Nick Leverton) writes:

> Here's a patch to your original:
>
> --- sepdate.pl.orig 1996-05-31 16:43:22.000000000 +0100
> +++ sepdate.pl 2004-08-13 20:31:29.000000000 +0100
> @@ -44,7 +44,7 @@
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($thetime);
>
> printf ("%3s Sep %2d %2.2d:%2.2d:%2.2d %3s 1993\n",
> -(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],$days,$hour,$min,$sec,(EST,EDT)[$isdst]);
> +(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],$days,$hour,$min,$sec,strftime('%Z',localtime));

Needs a 'use POSIX qw(strftime);', though, doesn't it?

Bryce Utting

unread,
Aug 13, 2004, 5:07:20 PM8/13/04
to
Rich Holmes <rsholme...@mailbox.syr.edu> wrote:
> TimC <tcon...@no.astro.spam.swin.accepted.edu.here.au> writes:
>> Also Also: I be demanding to know why you are too on the EST
>> timezone. Damn you all who live in Eastern XXXX.

I wuz gonna say "'cos I'm too damn lazy to edit in NZST/NZDT", but
then Rich owned up:

> Hmm, I dunno why I didn't list in the 'bugs' comments the fact that
> sepdate assumes your time zone is either EST, if you're not on
> daylight savings time, or EDT, if you are.

--the $500 bounty for bugs applies, right?


butting

Nick Leverton

unread,
Aug 13, 2004, 7:24:05 PM8/13/04
to
In article <u4brhey...@mep1.phy.syr.edu>,
Rich Holmes <rsholme...@mailbox.syr.edu> wrote:
>ni...@leverton.org (Nick Leverton) writes:

>-(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],$days,$hour,$min,$sec,(EST,EDT)[$isdst]);
>>
>+(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$wday],$days,$hour,$min,$sec,strftime('%Z',localtime));
>
>Needs a 'use POSIX qw(strftime);', though, doesn't it?

That's in the version I saved ... I might have applied someone else's
patch, but can't be mine as I didn't know perl until just but recently.

Richard Holmes

unread,
Jan 16, 2021, 11:02:57 AM1/16/21
to
Happy 10000 Sep 1993, all!

Nick Leverton

unread,
Jan 16, 2021, 8:30:27 PM1/16/21
to
In article <8c84061d-a059-4401...@googlegroups.com>,
Richard Holmes <rs.h...@gmail.com> wrote:
>Happy 10000 Sep 1993, all!

&AOL!1!!111!

Nick
--
The net is like a vast sea of lutefisk with tiny dinosaur brains embedded
in it here and there. Any given spoonful will likely have an IQ of 1, but
occasional spoonfuls may have an IQ more than six times that!
- James 'Kibo' Parry
- Copyright NJ Leverton cos I posted it most recently !!!!1!!1!!!11!
It's McQ so you can't worlord it either!!11!!!!!!
--
"The Internet, a sort of ersatz counterfeit of real life"
-- Janet Street-Porter, BBC2, 19th March 1996

Paul Tomblin

unread,
Jan 16, 2021, 9:03:34 PM1/16/21
to
In a previous article, Nick Leverton <ni...@leverton.org> said:
>In article <8c84061d-a059-4401...@googlegroups.com>,
>Richard Holmes <rs.h...@gmail.com> wrote:
>>Happy 10000 Sep 1993, all!
>
>&AOL!1!!111!

Geez, they still let you two on here?

Paul Tomblin, Head _ _ ____
Automated Test Tools Team | | | | | __| ___._`.*.'_._
_______________ ______ ____| |________ | |_| |__ + * .o u.* `
/ ________ _ \ | __ | / ________ _ \ | ______| . ' ' |\^/| `.
| | | | / / | | | | | | | | | | / / | | | | | | \V/
| |__| | / /__| |_| | | | | |_| | / /__| |_| | | | /_\
\ _____/ \__________| |_| \___|_| \__________| |_| === _/ \_ ===
//
\\____ Phone: (613) 723-6500x8018 Mail: Gandalf Data Limited
/ _ \ Fax: Don't know it yet 130 Colonnade Road South
| |_| | Email: ptom...@gandalf.ca Nepean, Ontario
\_____/ or ab...@freenet.carleton.ca K2E 7J5 CANADA

Disclaimer: Maybe after I've worked here for more than a few days,
Gandalf will let me speak for them. For now, it's just me talking.
And it was my idea to put htat Wizard in there, so Mr. Tolkein, please
don't sue Gandalf.

"And the trees are all kept equal now,
with axes, and saws" - RUSH


_
___ (_)
_/XXX\
_ /XXXXXX\_ __
X\__ __ /X XXXX XX\ _ /XX\__ ___
\__/ \_/__ \ \ _/X\__ /XX XXX\____/XXX\
\ ___ \/ \_ \ \ __ _/ \_/ _/ - __ - \__/
___/ \__/ \ \__ \\__ / \_// _ _ \ \ __ / \____//
/ __ \ / \ \_ _//_\___ __/ // \___/ \/ __/
__/_______\________\__\_/________\__/_/____/_____________/_______\____/_______
___
/L|0\
/ | \
/ \
/ | \
/ \
/ __ | __ \
/ __/ \__ \
/ /__ | __\ \
/___________________\

/ | \
/ _|_ \
/ ____/___\____ \
___________[o0o]___________
O O O

"Cherokee two niner zero, proceed on course, contact departure
one one niner point five five"

0 new messages