. Your example works fine (mm/dd/yyyy). Oi. Yay me for not paying closer attention. You're right, mm/dd/yyyy does not get parsed by #to_date or #to_time. My apologies. To the OT, because you know the format is mm/dd, flip them around first Accept Solution Reject Solution. you can achieve this by create common function and get datetime object and based on object you can get any format as you wish. Copy Code. DateTime expextedDate = GetFormatedDate ( 11/28/2013 ); string expextedFormat = expextedDate.ToString ( dd/MM/yyyy ); private DateTime GetFormatedDate ( string.
I am really confused about how to order by date formats. For the format YYYY-MM-DD you will do this:ORDER BY date DESC... How will you order by DD/MM/YYYY