Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 790
  • Last Modified:

how to retrieve in date time as dd-mm-yyyy hh:mm:ss:ss

Hi experts,

how do i achieve the above

thanks
0
SirReadAlot
Asked:
SirReadAlot
  • 3
  • 2
2 Solutions
 
talspaugh27Commented:
select convert(varchar(30), getdate(), 105) + ' ' + convert(varchar(30), getdate(), 108)
change the getdate to your date parameter
0
 
wshark83Commented:
select getdate(), convert(varchar(12), getdate(), 107), convert(varchar(10), getdate(), 108)

Results

getdate()
2007-11-20 16:51:11.460      

convert(varchar(12), getdate(), 103)
20/11/2007

convert(varchar(10), getdate(), 108)
16:51:11
0
 
talspaugh27Commented:
lol both comments came in at the exact same time, looks like EE needs to break it down to the second level on the timestamps
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
SirReadAlotAuthor Commented:
sorry

i forgot like this

dd-mm-yyyy hh:mm:ss:sss

sorry
0
 
SirReadAlotAuthor Commented:
ignore above post pls
0
 
talspaugh27Commented:
if you are wanting the milliseconds also would be
select (convert(varchar(30), getdate(), 105) + ' ' + convert(varchar(30), getdate(), 114))
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now