Hi Folks,
first of all: compliments to all of you. I’ve been reading around here for a bit, found quite a few useful hints for my considerable small problems and enjoyed the nice and helpful attitude of the active forum members.
Now I’ve got a problem that seems a bit tricky to me and I couldn’t find anything on the net so far:
1.) What I need in general is a field where I can enter a number directly that is interpreted as time (e.g. 1023 would be interpreted as 00:10:23) and that can be as well changed by 1-3 steppers (3 would be ideal (h / m /s))
2.) Since I could find no better, I decided to use the date picker control. It has only one stepper but seems more or less suitable for my needs.
3.) Now comes the point where I arrived so far: when I read the contents of the date picker as time string, i always get something like ‘01:01:01 AM’. I would not mind if I had only 12 hours max. to enter the time, but I cannot have the AM/PM at the end.
4.) Here’s the question: How can I convert the content from date picker to the 24hr format OR is there any (maybe a lot smarter) way of entering timecodes?
here’s (more or less) my code:
[code]tell window “dMain”
set the_date to content of control “myTimecode”
set the_time to the time string of the_date
end tell
→ the_time = “01:02:03 AM”[/code]
The AM has to go _and I have problems since 12:00:00 AM in 12h format would be 00:00:00 in 24h format ( I need the 00:00:00 ).
Thanks for any hint, and please excuse any errors in my English.
sbx
Model: pb g4 al
AppleScript: xcode 2.2
Browser: Firefox 1.0.7
Operating System: Mac OS X (10.4)