Re: time to gmt
Re: time to gmt
- Subject: Re: time to gmt
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 14 Mar 2007 23:07:28 -0400
On 3/14/07, Michelle Steiner <email@hidden> wrote:
You're in an area where daylight time is in effect, so if the date
you're converting is not during daylight time, you'll be an hour
off.
The problem is that "time to gmt" is a constant; what is needed is a
function that calculates the offset for the time in question rather
than right now.
Well, you can use Perl...
do shell script "perl -MTime::Local -MPOSIX -e 'print strftime("%d%b%y
%I:%M%p%Z", localtime(timegm(0,0,10,1,0,2007)))'"
--> 01Jan07 05:00AMEST
The tricky bit there is parsing the date into the arguments to timegm
(sec, min, hour, date, month (0=Jan through 11=Dec), year). (You can
use the Time::ParseDate module to convert a string representation, but
that module's not bundled).
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden