Hi Guys ,
i agree its a lame question and can get lots of resource online via google , i really want to find the correct answer as it really driving me nuts
The scenario is , i need to set & save & display the datetime to dd/MM/yyyy , i have already change the culture to en-US and the Dateformat to dd/MM/yyyy in the production server and have via code i am passing the below code
DateTime uploadedOn = DateTime.ParseExact(System.DateTime.Now.ToShortDateString(), "dd/MM/yyyy", CultureInfo.InvariantCulture);
drDocuments["UploadedOn"] = uploadedOn.ToShortDateString();
whenever i try on my developement system it works and assuming that its fixed , i deploy to uat and production , but there is giving the error
Input string is not a valid datetime
i have made sure that regional settings on both the machine my developement and production server are same , can anybody please advise where i am going wrong , or any suggestion or adivce which will help me to overcome the issue, please , really need experts help , i have surrendered and finally turned to expert opinion , Hope CP Members can help