Date Time Problem

  • Thread starter Thread starter Paul Beckett
  • Start date Start date
P

Paul Beckett

My dates are stored in the format MM/dd/yyyy hh:mm:ss

However I want to work with dd/MM/yyyy only (note the reversal of month and
day).

I have been able to display the correct formatin a datagrid by using <%#
DataBinder.Eval(Container.DataItem, "Date", "{0:dd MMM yyyy}") %>

I have been able to get the correct format to appear in an update form by
using DateTime.Parse

Now I want to be able to input the date as dd/MM/yyyy in my form and have it
altered to MM/dd/yyyy so it is accepted by the database.

Can I do it by altering the following line?


<Parameter Name="@DOB" Value='<%# IIf((Request.Form("DOB") <> Nothing),
Request.Form("DOB"), "") %>' Type="Date" />



Any ideas,

Paul Beckett
 
Hi Paul,

Did you ask this also in the special newsgroup for webdatagrids

microsoft.public,dotnet.framework.aspnet.datagridcontrol

I could have helped you with the windowsform datagrid, but from this I do
not know it.
(And it goes realy totaly different I see)

I hope you find your answer

Cor
 
Back
Top