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 get server time in SQL Server

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

Share

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

This article introduces you how to get server time in SQL Server, the content is very detailed, interested friends can refer to, hope to be helpful to you.

How to get the current system time with SQL statement in SQL SERVER 2000

Is to use GETDATE ()

GetDate () in Sql

A very powerful date formatting function in Sql Server

Select CONVERT (varchar, GETDATE (), 0): 05 16 2008 10:57AMSelect CONVERT (varchar, GETDATE (), 1): 05/16/08Select CONVERT (varchar, GETDATE (), 2): 08.05.16Select CONVERT (varchar, GETDATE (), 3): 16/05/08Select CONVERT (varchar, GETDATE, 4): 16.05.08Select CONVERT (varchar, GETDATE (), 5): 16-05-08Select CONVERT (varchar (100), GETDATE () 6): 16 05 08Select CONVERT (varchar, GETDATE (), 7): 0516, 08Select CONVERT (varchar, GETDATE (), 8): 10:57:46Select CONVERT (varchar, GETDATE (), 9): 0516 2008 10:57:46:827AMSelect CONVERT (varchar, GETDATE (), 10): 05-16-08Select CONVERT (varchar, GETDATE (), 11): 08/05/16Select CONVERT (varchar, GETDATE (), 12): 080516Select CONVERT (varchar (100), GETDATE () 13): 16 05 2008 10:57:46:937Select CONVERT (varchar, GETDATE (), 14): 10:57:46:967Select CONVERT (varchar (100), GETDATE (), 20): 2008-05-16 10:57:47Select CONVERT (varchar, GETDATE (), 21): 2008-05-16 10:57:47.157Select CONVERT (varchar, GETDATE (), 22): 05lap 1608 10:57:47 AMSelect CONVERT (varchar (100), GETDATE () 23): 2008-05-16Select CONVERT (varchar, GETDATE (), 24): 10:57:47Select CONVERT (varchar, GETDATE (), 25): 2008-05-16 10:57:47.250Select CONVERT (varchar, GETDATE (), 100): 05 16 2008 10:57AMSelect CONVERT (varchar, GETDATE): 05/16/2008Select CONVERT (varchar, GETDATE): 2008.05.16Select CONVERT (varchar (100), GETDATE () 16/05/2008Select CONVERT: 16.05.2008Select CONVERT (varchar, GETDATE): 16-05-2008Select CONVERT (varchar, GETDATE): 16 05 2008Select CONVERT (varchar, GETDATE): 05 16, 2008Select CONVERT (varchar, GETDATE): 10:57:49Select CONVERT (varchar, GETDATE, 109): 05 16 200810:57:49:437AMSelect CONVERT (varchar GETDATE: 05-16-2008Select CONVERT: 2008/05/16Select CONVERT (varchar, GETDATE): 20080516Select CONVERT (varchar, GETDATE): 16 05 2008 10:57:49:513Select CONVERT (varchar, GETDATE): 10:57:49:547Select CONVERT: varchar, GETDATE (): 2008-05-16 10:57:49Select CONVERT (varchar, GETDATE) 2008-05-16 10:57:49.700Select CONVERT (varchar (100,126): 2008-05-16T10:57:49.827Select CONVERT (varchar (100,130): 18 142710:57:49:907AMSelect CONVERT (varchar (100,131): 18/04/142710:57:49:920AM)

Get SQL Server server time

Insert into tablename (Date) value getDate ()

"select getdate () as serverDate" and then reading the serverDate property is the SQL Server server time.

You can also get it directly with the following statement: select getdate () select CURRENT_TIMESTAMP

The format of the obtained time is as follows: 2016-07-07 14 purl 07purl 15.670

On how to get server time in SQL Server to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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