heck of a time coercing string to text

Hi, Greg. I suppose we’ll have to cheat a little here. If you tell us exactly where the text file comes from and post the exact code that you’re using to read it, to get the AppleScript date from it, and to apply the date to the target file, we won’t have to keep guessing what you’re doing wrong from the error messages and partial event logs. :slight_smile:

Playing the safe card here


set t to (current date) as string
tell me to set d to date t --> date "maandag 30 oktober 2006 2:02:1"

the conversion works with the long date format.
However, something strange happens: for second values < 10 the leading zero gets lost so 2:02:01 → 2:02:1
even while my International prefs are set to have “leading zero’s” in their short/medium/long format seconds spec.

Hello

Are you sure that the format for the seconds is explicitely defined in your settings.

On my machine it wasn’t and I got a single digit too.

I added the seconds in the short time format, set them to two digits and now it works fine.

Yvan KOENIG (from FRANCE lundi 30 octobre 2006 07:49:39)

You’re right - I overlooked that when modding the time.
Now my International PrefPane shows “do 5, 19:08:09” as short time format (the trick is to copy/paste those symbols from the date panel!!) and now I supress the seconds in the Date/Time PrefPane so the menubar shows “do 5, 19:08”