Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 792
  • 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 Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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