Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Altering how DateTime is displayed

Author  Topic 

crugerenator
Posting Yak Master

126 Posts

Posted - 2009-09-04 : 12:54:01
I was going to write a script to do this, but I remembered that Sql can do this fairly easily (if I remember correctly). I know if you do a convert() it changes the dateTime to a string, but that's fine with me. I'm outputting a dateTime field that's my timeStamp for when a record is submitted to my database. The issue I'm having is that my javascript library to sort this fied when it's in a column in an HTML table needs the timestamp to be formatted differently.

Basically, I need '9/3/2009 9:03:48' AM to display as '09/03/2009 09:03:48 AM'.

I've actually already written a custom function for the library that I'm using that converts the time portion of the timestamp to military time. So the real problem here is the date. I need my month and days to be 2 chars, padded w/ a zero if it's a single digit day or month.

Thanks in advance!

crugerenator
Posting Yak Master

126 Posts

Posted - 2009-09-04 : 14:12:04
nevermind, I just wrote it in javascript. Thank you to anyone who looked into this though.
Go to Top of Page
   

- Advertisement -