7
Answers

Date Time conversion

Hi ,

I am converting MM/dd/yyyy date to yyyy-MM-dd hh:mm:ss using dateobject.ToString("yyyy-MM-dd hh:mm:ss").

Its converting perfectly in given format but in MM-dd-yyyy format there is no hour specified and hour is appearing in this yyyy-MM-dd hh:mm:ss format .

For e.g.  date is 05/07/2009   i.e. 7 May 2009 and after converting to yyyy-MM-dd hh:mm:ss format, date is appearing as 2009-05-07 12:00:00.

From where this 12 is appearing ? We don't want this 12 . The date should display like  2009-05-07 00:00:00.

Please suggest solution.

Thanks
Prasad

Answers (7)
0
Iftikar Hussain
NA 18.9k 275.5k 11y
Hi,
        Try like this, use unadorned:yes;

ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "javascript:var ans = window.showModalDialog('TransactionHistoryDetail.aspx?' + '&rowID=" + rowID + "&Type=" + OrderType + "&OrderNo=" + OrderNo + "', 'unadorned:yes;dialogWidth=1000px;dialogHeight=700px;resizable: yes;dialogLeft=' + ((screen.width - 1000) / 2) + ';dialogTop=' + (screen.height - 700) / 2 + ''); ", true);

Regards,
Iftikar