how to change the date time format 2011-09-01 09:39:23 to 2011-Aug-01 09:39:23 in asp.net
I am using this DateTime.Now; to get the date time but I want it in 2011-Aug-01 09:39:23 format, how to do that
I set datetime as string now = DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss");
both did not work
param[1] = new MySqlParameter("@Created", MySqlDbType.DateTime);
param[1].Value = now;
command.Parameters.AddWithValue("@Created", now);
param[2] = new MySqlParameter("@Modified", MySqlDbType.DateTime);
param[2].Value = DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss");
command.Parameters.AddWithValue("@Modified", DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss"));