• 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
Re: Filemaker changes 04 to 1904
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filemaker changes 04 to 1904


  • Subject: Re: Filemaker changes 04 to 1904
  • From: Malcolm Fitzgerald <email@hidden>
  • Date: Thu, 28 Oct 2004 12:27:31 +1000

Eric Geoffroy wrote:

set s to date "Friday, October 22, 2004 12:00:00 AM"
short date string of s
-- returns "10/22/04"

That's where I wish it said 2004.


On 10/27/04 5:57 PM, "Malcolm Fitzgerald" <email@hidden> wrote:
set d to (get current date)
set dateString to short date string of d
set dateString to text 1 thru 6 of dateString & year of d
--> "28/10/2004"

then Andrew Oliver wrote:
And on January 1st 2005 you get 1/1/052005

silly, silly me!

set dateString to text 1 thru -3 of dateString & year of d

Though now Michelle has piped up everyone will have changed their preferences ;-)

It's more reliable to use chunks:

words of (short date string of current date)

-- {"28", "10", "04"}

but the order of month and day is a matter of preference

set d to current date
set {dMth,dDate} to words of (short date string of d) -- MM/DD/YY
set {dDate,dMth} to words of (short date string of d) -- DD/MM/YY

set strDate to dDate & "/" & dMth & "/" & year of d

Does this line require localisation:

set dMth to (offset of (text 1 thru 3 of (month of d as string)) in "..janfebmaraprmayjunjulaugsepoctnovdec") / 3


-- Malcolm Fitzgerald phone: 02 9318 0877 Database Manager fax: 02 9318 0530 The Australian Society of Authors <http://www.asauthors.org> _______________________________________________ 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
References: 
 >Re: Filemaker changes 04 to 1904 (From: Andrew Oliver <email@hidden>)

  • Prev by Date: text item delimiters
  • Next by Date: Mail script
  • Previous by thread: Re: Filemaker changes 04 to 1904
  • Next by thread: Inheritance and Loaded Libraries
  • Index(es):
    • Date
    • Thread