Dear Friends, I defined these two variables as a date Date dateWork Date ConvertedDate and I don't know why it gives me this error message? and doesn't accept it. how can I solve it? ConvertedDate = formatter.format(dateWork); Thanks, Elahe Error ------ Incompatible type for =. Can't convert String to Date. ConvertedDate = formatter.format(dateWork); ^ 1 error
Thanks,
Elahe
Col Bell
Greenhorn
Joined: Mar 21, 2002
Posts: 12
posted
0
If you take a look at the JavaDoc for the format() function you'll see it is defined like:
That is it returns a String object, not a Date. The purpose of the function is to give you the passed Date object in a human-readable form. [ April 13, 2002: Message edited by: Col Bell ]