coercing text to time
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