Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

I have a datetime (dd/MM/yyyy Format) conversion error when i save values, retrieve, search values. i gave MM/dd/yyyy Format Its take before 12 days dd/MM/yyyy Format after 12 takes MM/dd/yyyy format.

Its a big problem to retrieve a report.. how to solve this problem..



Thanks & Regards,
Vivek .R
Posted
Comments
Arasappan 23-Nov-15 0:36am    
the format u saved in sql is
Jawad Ahmed Tanoli 23-Nov-15 0:41am    
can you share your error during conversion and code
Vivek.anand34 23-Nov-15 2:09am    
in database its saved yyyy-mm-dd with time format...

1 solution

Use ``yyyy-MM-dd`` format then.
It has no variant and should work always.
Also check following-
Using the InvariantCulture Property[^]

Thanks :)
 
Share this answer
 
Comments
Vivek.anand34 23-Nov-15 2:22am    
yyyy-MM-dd is not good for client.. thats why am trying dd/MM/yyyy format... I will InvariantCulture Property above link...
Vivek.anand34 23-Nov-15 4:14am    
Actually its My Mistake I converted the datetime to date its a problem. I solved it.. acutally in db i put datetime format. and Textbox (MM/dd/yyyy) format. It executes now...
Suvendu Shekhar Giri 23-Nov-15 4:36am    
Still it should work. You can store a date value in datetime field.
Anyway, great that it is solved.
Vivek.anand34 23-Nov-15 4:14am    
Thanks For Help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900