However GE expects dates in the format
2006-11-17
which isn't so bad in itself. It's AppleScript's fault that it is a pain to format dates other than the system's preset. You just do aset dateString to (year of theDate) & "-" & (month of theDate as number) & "-" & (day of theDate)
and there you go. Nevertheless GE still choked on my formatted dates:
2006-9-5
can't be parsed by Google Earth. The leading 0
is mandatory!? WTF!?Well here is the solution:
on format_date(theDate)
tell theDate
set y to year as string
set m to (month of theDate as number) as string
if (count of m) is 1 then set m to "0" & m
set d to day as string
if (count of d) is 1 then set d to "0" & d
end tell
return y & "-" & m & "-" & d
end format_date