Re: Finding the oldest date in a list
Re: Finding the oldest date in a list
- Subject: Re: Finding the oldest date in a list
- From: "John W. Baxter" <email@hidden>
- Date: Thu, 20 May 2004 08:29:52 -0700
On 5/18/2004 13:14, "Steven Valenti" <email@hidden> wrote:
>
I would like to find the oldest date in a list but just can't seem to
>
think how to evaluate all of the items. Can anyone help? The items in
>
this list are names of folders that were created in a backup script and
>
after 5 days I need to delete the oldest backup.
>
>
set BackUpFolder to {"5/11/2004", "5/12/2004", "5/13/2004",
>
"5/14/2004", "5/17/2004", "5/18/2004"}
>
set FirstDate to item 1 of BackUpFolder
>
set SecondDate to item 2 of BackUpFolder
>
date FirstDate < date SecondDate
>
>
You have received good answers.
For the next project, I suggest that you use a date format which sorts
naturally. ISO's format is nice:
YYYYMMDD
or, if you like separators
YYYY-MM-DD
Either will sort as text with no hassle...as a bonus Finder will present
them in order for you without bothering to change from alphabetic sorting in
that folder.
--John (who stopped using / in file names the day Apple released A/UX)
_______________________________________________
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.