• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Universal Date Entry (was: Date - 1 day in Address Book)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Universal Date Entry (was: Date - 1 day in Address Book)


  • Subject: Universal Date Entry (was: Date - 1 day in Address Book)
  • From: kai <email@hidden>
  • Date: Wed, 23 Jul 2003 03:56:09 +0100

on Mon, 21 Jul 2003 09:49:16 -0700, Michelle Steiner wrote:

> On Monday, July 21, 2003, at 09:00 AM, John Delacour wrote:
>
>>>
>>>> set d to "2.9.1970"
>>>> set theDate to date d
>>>> theDate as string
>>>> --> "MercoledC,, 2 settembre 1970 0:00:00"
>>>
>>> --> "Monday, February 9, 1970 12:00:00 AM"
>>
>> Not outside America!
>
> I was trying to show that using the number format for dates is not a
> universal solution. It seems that there is no universal solution.

I suppose one might try to adapt the handler posted by Paul B, which in turn
was based on one of Nigel Garvey's rather neat tricks. Here's a variation
that attempts to offer an alternative to the repeat loop:

-------------------------------------------------------
(Any wrapped lines abutting the left edge of the window
should be reconnected to the end of the previous line)
-------------------------------------------------------

--===========

on uDate(v)
set t to "1.2.3" -- modify to dictate input sequence
set {day:d, year:y} to date t
set y to y mod (y div 100 * 100)
set text item delimiters to "." -- the separator used for input
set u to (get v's {text item d, text item (6 - d - y), text item y})
as string
set text item delimiters to ""
date u
end uDate

uDate("2.9.1970") as string

--===========

(The list server may choke on one or two of the resulting weekday names):

--> "Wednesday, 2 September 1970 12:00:00 am" (Australian)
--> "woensdag, 2 september 1970 12:00:00 am" (Belgian)
--> "02 de setembro de 1970 12:00:00 am" (Brazilian)
--> "Wednesday, September 2, 1970 12:00:00 am" (British)
--> "onsdag 2. september 1970 12:00:00 am" (Danish)
--> "woensdag, 2 september 1970 12:00:00 am" (Dutch)
--> "keskiviikko 2. syyskuu 1970 12:00:00 am" (Finnish)
--> "mercredi 2 septembre 1970 12:00:00 am" (French)
--> "Mercredi 02 septembre 1970 12:00:00 am" (French Canadian)
--> "Mittwoch, 2. September 1970 12:00:00 am" (German)
--> "Mercoledl, 2 settembre 1970 12:00:00 am" (Italian)
--> "onsdag 2. september 1970 12:00:00 am" (Norwegian)
--> "miircoles, 2 septiembre 1970 12:00:00 am" (Spanish)
--> "onsdag 2 september 1970 12:00:00 am" (Swedish)
--> "Mercredi, 2 septembre 1970 12:00:00 am" (Swiss French)
--> "Mittwoch, 2. September 1970 12:00:00 am" (Swiss German)
--> "Mercoledl, 2 settembre 1970 12:00:00 am" (Swiss Italian)
--> "Wednesday, September 2, 1970 12:00:00 am" (U.S.)

The first line of the handler can be modified to a preferred input sequence.
For example, changing it from <set t to "1.2.3"> to <set t to "2.1.3"> gave
me these results:

--> "Monday, 9 February 1970 12:00:00 am" (Australian)
--> "maandag, 9 februari 1970 12:00:00 am" (Belgian)
--> "09 de fevereiro de 1970 12:00:00 am" (Brazilian)
--> "Monday, February 9, 1970 12:00:00 am" (British)
--> "mandag 9. februar 1970 12:00:00 am" (Danish)
--> "maandag, 9 februari 1970 12:00:00 am" (Dutch)
--> "maanantai 9. helmikuu 1970 12:00:00 am" (Finnish)
--> "lundi 9 fivrier 1970 12:00:00 am" (French)
--> "Lundi 09 fivrier 1970 12:00:00 am" (French Canadian)
--> "Montag, 9. Februar 1970 12:00:00 am" (German)
--> "Lunedl, 9 febbraio 1970 12:00:00 am" (Italian)
--> "mandag 9. februar 1970 12:00:00 am" (Norwegian)
--> "lunes, 9 febrero 1970 12:00:00 am" (Spanish)
--> "mendag 9 februari 1970 12:00:00 am" (Swedish)
--> "Lundi, 9 fivrier 1970 12:00:00 am" (Swiss French)
--> "Montag, 9. Februar 1970 12:00:00 am" (Swiss German)
--> "Lunedl, 9 febbraio 1970 12:00:00 am" (Swiss Italian)
--> "Monday, February 9, 1970 12:00:00 am" (U.S.)

---
kai
_______________________________________________
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.

  • Follow-Ups:
    • Re: Universal Date Entry (was: Date - 1 day in Address Book)
      • From: Gary Lists <email@hidden>
  • Prev by Date: Re: Applescripting Preview or print to pdf for pdf creation
  • Next by Date: Re: Why is AS so poorly documented?
  • Previous by thread: Re: Applescripting Preview or print to pdf for pdf creation
  • Next by thread: Re: Universal Date Entry (was: Date - 1 day in Address Book)
  • Index(es):
    • Date
    • Thread