Working with Dates

I’m trying to write a script that works with dates and need some help. I want a user to be able to enter a date like “3/14/2002”. I’m wondering if there is a way that from that input that I would be able to make the computer tell me what day that is…i.e. Wednesday.
Also, if I want to then go to the next day from the supplied date I would normally do + days1, but when I get the user supplied date I’m having difficulty declaring it as a date. So the +days1 isn’t working. Any ideas on what I’m doing wrong?
Thanks! Dave

On my US setup, if I paste this into a script window: set userDate to date “3/14/2002”
It compiles to:

set userDate to date "Thursday, March 14, 2002 12:00:00 AM"


 set tomorrowDate to userDate + (days * 1)
Returns: date "Friday, March 15, 2002 12:00:00 AM"

Dates can be hairy beasts and results vary depending on local conditions.

Hi Dave,
Try running this in the Script Editor and looking at the result.
gl, Kel.

Sorry, I forgot to post to script! Forgot my password too!

 set user_date to "3/14/2002" 
 set the_date to date user_date 
 set day_name to (weekday of the_date) 
 set next_day to (the_date + 1 * days) 
 set next_day_name to (weekday of next_day) 
 {user_date, the_date, day_name, next_day, next_day_name} -- look at the results 

Check out:
for some useful and flexible string-date-string conversion tools.

Exactly what I was looking for! Thanks much! Dave