A
Andre
Hi,
I have a problem with my Date conversion and can't find a way to resolve
it.
Here's my code :
friday= DateTime.Now.AddDays((day - (day * 2 + 2)))
thursday= friday.AddDays(6)
friday= friday.ToString("d-M-yyyy")
thursday= thursday.ToString("d-M-yyyy")
friday = #7/9/2004 9:51:25 AM#
thursday = #7/15/2004 9:51:25 AM#
After the conversion friday become 9/7/2004 but whit the thursday
conversion i receive this error : System.InvalidCastException:
Cast from string "15-7-2004" to type 'Date' is not valid.
I can't find a way to make it work, maybe the conversion think that 15
is the month instead of the day, i don't know...
Thanks.
I have a problem with my Date conversion and can't find a way to resolve
it.
Here's my code :
friday= DateTime.Now.AddDays((day - (day * 2 + 2)))
thursday= friday.AddDays(6)
friday= friday.ToString("d-M-yyyy")
thursday= thursday.ToString("d-M-yyyy")
friday = #7/9/2004 9:51:25 AM#
thursday = #7/15/2004 9:51:25 AM#
After the conversion friday become 9/7/2004 but whit the thursday
conversion i receive this error : System.InvalidCastException:
Cast from string "15-7-2004" to type 'Date' is not valid.
I can't find a way to make it work, maybe the conversion think that 15
is the month instead of the day, i don't know...
Thanks.