Coerce time thanks
Coerce time thanks
- Subject: Coerce time thanks
- From: Rich Carroll <email@hidden>
- Date: Fri, 22 Aug 2003 08:06:15 -0500
John,
Thanks so much for your help. I've been meaning to crack open that perl
script book. I had an odd some odd results over the course of two days
however. When I ran it on 8.21.03 got correct results (08/21/03).
I ran it again this morning and I get "12/31/69". Changing d1 or d2 has no
effect.
I was so psyched yesterday since you did in 5 lines what took 40 in the old
school Applescript wrangle I worked out. I'll be cracking open my unused
Perl book when I get into the office, but if maybe you could explain your
madness a bit I can debug it myself.
--
Richard McCormick-Carroll
Application Specialist
Capps Digital Development Group
email@hidden
email@hidden
312.220.1679 @ Desk
312.520.1679 @ Cell
www.cappsdigital.com
Date: Wed, 20 Aug 2003 22:09:22 +0100
To: <email@hidden>
From: John Delacour <email@hidden>
Subject: Re: Coerce time
At 2:42 pm -0500 20/8/03, Rich Carroll wrote:
>
Is there a simple way to coerce "August 20, 2003" to 08/20/03?
>
I can figure out a complicated series of steps to do it "manually," I'm just
>
hoping someone knows a better way.
You can do it in the shell or with perl:
set d1 to "1/1/70"
set d2 to "August 20, 2003"
set d to (get date d2) - (get date d1) -- or (current date) - (get date d1)
do shell script "perl -e '@t = localtime " & d & ";
printf qq~d/d/d~, $t[4]+1,$t[3],$t[5] ;'"
JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.