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
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