Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Convert function to format time output in sql

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

In this issue, the editor will bring you about how to use the Convert function to format the time output in sql. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.

Select CONVERT (varchar), GETDATE (), 0): 05 16 2006 10:57AM Select CONVERT (varchar (100), GETDATE (), 1): 05 varchar 16 Select CONVERT (varchar), GETDATE (), 2): 06.05.16 Select CONVERT (varchar, GETDATE (), 3): 16-05-06 Select CONVERT (varchar (100), GETDATE (), 4): 16.05.06 Select CONVERT (varchar (100), GETDATE (), 5): 16-05-06 Select CONVERT (varchar GETDATE (), 6): 16 05 06 Select CONVERT (varchar, GETDATE (), 7): 05 16,06 Select CONVERT (varchar, GETDATE (), 8): 10:57:46 Select CONVERT (varchar, GETDATE (), 9): 05 16 2006 10:57:46:827AM Select CONVERT (varchar, GETDATE (), 10): 05-16-06 Select CONVERT (varchar, GETDATE (), 11): 06GETDATE (varchar), GETDATE () 12): 060516 Select CONVERT (varchar, GETDATE (), 13): 16 05 2006 10 GETDATE (), 14): 10 varchar (100), GETDATE (), 14): 10 Select CONVERT 57 46 Select CONVERT (varchar), GETDATE (), 20): 2006-05-16 10:57:47 Select CONVERT (varchar, GETDATE (), 21): 2006-05-16 10 57 Select CONVERT (varchar), GETDATE () 22): 05 AM Select CONVERT 16 06 10:57:47 AM Select CONVERT (varchar), GETDATE (), 23): 2006-05-16 Select CONVERT (varchar), GETDATE (), 24): 10:57:47 Select CONVERT (varchar, GETDATE (), 25): 2006-05-16 1057 GETDATE 47.25 Select CONVERT (varchar, GETDATE, 100): 05 16 2006 10:57AM Select CONVERT (varchar, GETDATE): 0516 Select CONVERT GETDATE (): 2006.05.16 Select CONVERT (varchar, GETDATE (), 1010): 16.05.2006 Select CONVERT (varchar, GETDATE (), 2006): 16-05-2006 Select CONVERT (varchar, GETDATE): 1605 2006 Select CONVERT (varchar, GETDATE (), 107): 05 16,2006 Select CONVERT (varchar (100), GETDATE () 10:57:49 Select CONVERT (varchar, GETDATE): 0516 2006 10:57:49:437AM Select CONVERT (varchar, GETDATE): 05-16-2006 Select CONVERT (varchar, GETDATE): 2006-05-16 Select CONVERT (varchar, GETDATE): 20060516 Select CONVERT (varchar, GETDATE,): 16 05 2006 1015 10:57:49:437AM Select CONVERT (varchar), GETDATE () Varchar: 2006-05-16 10:57:49 Select CONVERT (varchar, GETDATE, 121l): 2006-05-16 10 Select CONVERT 5749.700 Select CONVERT (varchar), GETDATE (), 126126: 2006-05-16T10:57:49.827 Select CONVERT (varchar, GETDATE (), 130): 18? 1427 10:57:49:907AM Select CONVERT (varchar GETDATE (), 131): 18 10:57:49:920AM 04 GETDATE 1427 the above is how to format the time output using the Convert function in sql shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report