• 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 Help - D&T stamp w Short dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date Help - D&T stamp w Short dates


  • Subject: Re: Date Help - D&T stamp w Short dates
  • From: Harald E Brandt <email@hidden>
  • Date: Sat, 11 Jan 2003 14:55:17 +0100

+--> Daniel A. Shockley wrote 03-01-07:
> Basically, I would like to create a date - time stamp that ideally would
look like the following

IDEAL1: 01-06-03 09-23-21 AM (mm-dd-yy)
> IDEAL2: 2003-01-06 09-23-21 AM (yyyy-mm-dd)

I keep forgetting to optimize this handler:
set ideal1 to DateToString( "mm-dd-yy hh-MM-ss ?m", current date )
set ideal2 to DateToString( "yyyy-mm-dd hh-MM-ss ?m", current date )

Hmm, I've got a simpler (faster) format-date handler, which cannot give you names of months or days, but it's pretty fast, just doing a bunch of replaces,
+--


How about using Perl or other native Unix tools in OS X?

Getting the current time as a string of numbers is easy, by for instance doing:
do shell script "perl -e '$, = q(,); print localtime();'"

But I have so far not found a way to go the other way around, i.e supplying a string and get a date. Or a way to take an AS date to a unix date.
Does anyone know of a native way of doing these things?

(Just using AS to do "date aSuitablyFormattedString" has the disadvantage of being dependent on the international settings for short date, so that is not so good.}


________________________________________________________
Harald E Brandt email@hidden http://bragit.com
_______________________________________________
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.

References: 
 >Re: Date Help - D&T stamp w Short dates (From: "Daniel A. Shockley" <email@hidden>)

  • Prev by Date: Re: Command line text substitution
  • Next by Date: Re: Re; Keynote, is it scriptable (XML?) -addendum
  • Previous by thread: Re: Date Help - D&T stamp w Short dates
  • Next by thread: Re: Date Help - D&T stamp w Short dates
  • Index(es):
    • Date
    • Thread