• 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: Date handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date handlers


  • Subject: Re: Date handlers
  • From: has <email@hidden>
  • Date: Thu, 17 Feb 2005 09:30:04 +0000

Kevin Meaney wrote:

Does anybody have handlers (or script objects) for handling dates that are available publicly or they are happy to make public.

The AppleMods Date library <http://applemods.sourceforge.net> can both parse and format arbitrary date strings, e.g.:


-- auto-generated library loading code

property _Loader : run application "LoaderServer"

----------------------------------------------------------------------
-- DEPENDENCIES

property _Date : missing value

on __load__(loader)
	set _Date to loader's loadLib("Date")
end __load__

----------------------------------------------------------------------
-- main code

__load__(_Loader's makeLoader()) -- load libraries

set p to _Date's makeParser("yyyy mm dd HH MM SS") -- make a parser object

p's parseText("2004:01:21 13:55:29") -- parse string
--> {date "Wednesday, January 21, 2004 1:55:29 pm", missing value} -- date and timezone (if any)


If you've not used AppleMods' libraries before, you'll need to download and install AppleMods' Loader system first <http://applemods.sourceforge.net/getstarted.html>. Run the Loader installer, then download and add the Date library to the ASLibraries folder. You can use the LoaderWizard applet to generate the library loading code to paste at the top of your script.

HTH

has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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


  • Follow-Ups:
    • Re: Date handlers
      • From: Kevin Meaney <email@hidden>
  • Prev by Date: Re: [OT] DeveloperTools Vs Xcode Tools VS X11
  • Next by Date: Prompts in ARD
  • Previous by thread: Re: Date handlers
  • Next by thread: Re: Date handlers
  • Index(es):
    • Date
    • Thread