Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force Date Format "dd/MM/yyyy HH:mm:ss"

Status
Not open for further replies.

saturnius

Technical User
May 7, 2002
22
GB
Hello,
suddenly the date format changed for an unknown reason to
'May 10 2004 4:15PM'. This is part of a datagrid and the original fromat is in the table of the SQL server is '10/05/2004 16:15:00'. I use this code to get the parameter of the Stored Procedure cmd.Parameters.Add(New SqlParameter("@changedate", SqlDbType.DateTime)).Value = Now() - AND it worked until Friday .... Is there a way to format the "Date & Time"? Many thanks!

 
sat: If you're inside a DG's boundcolumn use:

Code:
DataFormatString="{0:dd MMM yyyy}"
 
Hi, Thanks for your answer. Apparently there was a problem with a stored procedure. I copied the text, deleted it, created a new SP and inserted the text - everything was working fine after.
Thanks,
Saturnius
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top