Date subtractions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Date subtractions

Newcomer
What am I doing wrong here?

I'm trying the following:

Date today yearsSince: (Date fromString: 'Nov 13, 1962')

But keep getting the error message "Invalid format for date"

Can someone guide me here please.

thanks

George


Reply | Threaded
Open this post in threaded view
|

Re: Date subtractions

Dmitry Zamotkin-3
Hi George,

> What am I doing wrong here?
>
> I'm trying the following:
> Date today yearsSince: (Date fromString: 'Nov 13, 1962')
> But keep getting the error message "Invalid format for date"

The method Date class>>fromString: depends on Windows locale settings >
default short date format. You can find it through Control Panel>Regional
Setting>Date. For example, I have next setting: "dd.MM.yyyy", and in my case
works:

Date fromString: '13.11.1962'

with *.*,
Dmitry Zamotkin