Ok simple problem
-
This is a simple problem that I cannot believe that I can't solve!! I have a C# ASP.NET site.... Easy! In my HTML/ASP I have a datagrid declared and one of the columns in my datagrid pulls dates from the database (through a data set) and displays them on the page. My dates come up looking like this: 21/02/2006 12:00:00 AM I want them to look like this: 21/02/06 I've tried to do this to the header DataFormatString="{0:dd/MM/yy}" but that doesn't work! Any suggestions to this problem would be awesomely appreciated!! Cheers everyone, Michael!!
-
This is a simple problem that I cannot believe that I can't solve!! I have a C# ASP.NET site.... Easy! In my HTML/ASP I have a datagrid declared and one of the columns in my datagrid pulls dates from the database (through a data set) and displays them on the page. My dates come up looking like this: 21/02/2006 12:00:00 AM I want them to look like this: 21/02/06 I've tried to do this to the header DataFormatString="{0:dd/MM/yy}" but that doesn't work! Any suggestions to this problem would be awesomely appreciated!! Cheers everyone, Michael!!
Why can't you query that format from the database itself? set dateformat 'dmy' select convert( varchar,cast(floor(cast(cast(dateColumn as datetime)as float)) as datetime),103) "Date" Hope that helps you.
Regards, Arun Kumar.A
-
Why can't you query that format from the database itself? set dateformat 'dmy' select convert( varchar,cast(floor(cast(cast(dateColumn as datetime)as float)) as datetime),103) "Date" Hope that helps you.
Regards, Arun Kumar.A
Cheers for that.... that did the job!! Thanks so much for you help Arun
-
This is a simple problem that I cannot believe that I can't solve!! I have a C# ASP.NET site.... Easy! In my HTML/ASP I have a datagrid declared and one of the columns in my datagrid pulls dates from the database (through a data set) and displays them on the page. My dates come up looking like this: 21/02/2006 12:00:00 AM I want them to look like this: 21/02/06 I've tried to do this to the header DataFormatString="{0:dd/MM/yy}" but that doesn't work! Any suggestions to this problem would be awesomely appreciated!! Cheers everyone, Michael!!
Please use yyyy-MM-dd, or it possible to allow the user's browser/OS to determine which format the user wants?
-
Cheers for that.... that did the job!! Thanks so much for you help Arun
If someone answered your question, you should vote for that for two main reasons: 1. To help others to recognize the right answer post that worked well 2. To help the one who helped you on his way up to be an MVP here, which's the only way to say thank you here in cp;) Please do vote. Cheers.
Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)
-
Please use yyyy-MM-dd, or it possible to allow the user's browser/OS to determine which format the user wants?
Well said. I can't believe the pompousness and insensitivity of the jerks who display dates as MM/dd/yyyy. I find it incredibly irritating and threw out Sunbird because of that. Too bad I can't throw out the corporate apps.
Cheers, Vıkram.
Déjà moo - The feeling that you've seen this bull before. Join the CP group at NationStates. Password:
byalmightybob
-
This is a simple problem that I cannot believe that I can't solve!! I have a C# ASP.NET site.... Easy! In my HTML/ASP I have a datagrid declared and one of the columns in my datagrid pulls dates from the database (through a data set) and displays them on the page. My dates come up looking like this: 21/02/2006 12:00:00 AM I want them to look like this: 21/02/06 I've tried to do this to the header DataFormatString="{0:dd/MM/yy}" but that doesn't work! Any suggestions to this problem would be awesomely appreciated!! Cheers everyone, Michael!!