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

date calculations


  • Subject: date calculations
  • From: Christian Vinaa <email@hidden>
  • Date: Thu, 10 Mar 2005 22:56:21 +0100

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 )

so I tried to script the time between START and END :

set emailList to {}
tell application "TextEdit" to tell ¬
(document 1's paragraphs where it contains "START:") to if (count) > 0 then copy paragraphs to end of emailList


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

Says:  cant convert to date or number

what is wrong ?  it is the same format as apples example ?

--
Christian Vinaa

...... Meanwhile, aunt Martha, having taken a tramp in the woods,
is lying in a ditch at the edge of town .........................
_______________________________________________
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 calculations
      • From: Andrew Oliver <email@hidden>
  • Prev by Date: Re: Why does this iPhoto applescript fail to produce new albums with photos in them?
  • Next by Date: RE: About keychain scripting
  • Previous by thread: Re: Why does this iPhoto applescript fail to produce new albums with photos in them?
  • Next by thread: Re: date calculations
  • Index(es):
    • Date
    • Thread