Re: iCal organization with dates & events & lists....
Re: iCal organization with dates & events & lists....
- Subject: Re: iCal organization with dates & events & lists....
- From: Adam Wuellner <email@hidden>
- Date: Thu, 17 Mar 2005 14:03:18 -0600
On Thu, 17 Mar 2005 01:21:05 -0800 (PST), Patrick Collins
<email@hidden> wrote:
> #1. When the start date of a calendar event is obtained, it appears as
> the long format "September 18, 2004 11:00:00 PM" for example... Now,
> from what I understand, you can normally treat variables defined as
> (current date) in a way that you can ask for the date in short-date
> form.. or just get the day, hour, etc... However, the date retreived
> by my script is not really a "date".. so I can't do anything like that
> to it.. I basically want the dates to show up as "9/18/04 11:00 PM"
> exactly.. but I don't know how the best way to do this is-- is there a
> simple way to say datestring = a date-- so then you can modify it like a
> date? Or do I need to do text delimiters, etc, and then set up a list
> of months, and make the program determine, if the first part is
> September then that = 9, etc.. My script already runs rather slow, so I
> am trying to avoid any extraneous tasks like this.
set datetime_string to my date_time("September 18, 2004 11:00:00 PM")
-- "9/18/04 11:00:00 PM" (NB: can't get rid of the seconds without
parsing text)
set datetime_string to my date_time("ooga booga")
-- "unrecognized date string"
on date_time(date_string)
local my_date
try
set my_date to date date_string
return short date string of my_date & " " & time string of my_date
on error
return "unrecognized date string"
end try
end date_time
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden