• 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
coercing text to time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

coercing text to time


  • Subject: coercing text to time
  • From: Robert Poland <email@hidden>
  • Date: Wed, 19 Oct 2005 14:38:26 -0600

Hi,

I am trying to get data from Excel. one data string might be {"Wednesday, October 19, 2005 12:00:0 PM", "10:00"}. I would like to coerce the text returned from Excel (0.489583333333) to time;

set activeColumns to {"1", "2", "3", "4"}
set xdatas to {"Wednesday, October 19, 2005 12:00:00 PM", "10:00"}
repeat with i from 1 to 2
set a to i as text
if activeColumns contains a then -- check only active cells
set testData to item i of xdatas as text
if i = 1 then
set testData to date testData
set testData to short date string of testData
end if
if i = 2 then
if testData ‚ "" then set testData to time string of testData
end if
end if
end repeat


testData

Gets error "Can't get time string of "0.489583333333", it should be 11:45(AM). Isn't there a simple way to do this?

Tia,
--
Bob Poland - Fort Collins, CO
http://www.ibrb.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


  • Follow-Ups:
    • Re: coercing text to time
      • From: Shane Stanley <email@hidden>
    • Re: coercing text to time
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Dialog simple question
  • Next by Date: Re: Days and hours
  • Previous by thread: Re: decompilation insanity
  • Next by thread: Re: coercing text to time
  • Index(es):
    • Date
    • Thread