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

Re: date calculations


  • Subject: Re: date calculations
  • From: Andrew Oliver <email@hidden>
  • Date: Thu, 10 Mar 2005 14:06:18 -0800

On 3/10/05 1:56 PM, "Christian Vinaa" <email@hidden> wrote:

> from apples website I got:
>
> set timeInvestment to (current date) - (date "tirsdag 1. marts 2005 20:00:00")
>
> this works ok  as it calculates time between the 2 dates
>
> i can get it in seconds, minutes, hours  whatever   no problem there
>
>
> but I have a text file  ( textEdit)  where I have a list of fx
>
> START: lørdag 5. marts 2005 09:10:06
> END: lørdag 5. marts 2005 09:52:56
>
> (  its just a basic  log in and log out )
>
> set myDt to characters 8 through 36 of item 3 of item 1 of emailList as text
> set timeInvestment to (current date) - myDt
>
> but script wont recoqnize   myDt  as a proper date

But it isn't a date, it's a string. You need to get AppleScript to coerce it
to a date first:

set timeInvestment to (current date) - date myDt

Andrew
:)

 _______________________________________________
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:
    • reg ex's
      • From: Christian Vinaa <email@hidden>
References: 
 >date calculations (From: Christian Vinaa <email@hidden>)

  • Prev by Date: RE: About keychain scripting
  • Next by Date: Re: Why does this iPhoto applescript fail to produce new albums with photos in them?
  • Previous by thread: date calculations
  • Next by thread: reg ex's
  • Index(es):
    • Date
    • Thread