Time when several databases obtain the system

Source: Internet
Author: User

ORACLE:

Familiar with system time: Select sysdate from dual time type acquisition;

Select to_char (sysdate, 'yyyy-mm-dd hh24: MI: ss') from dual; obtained in string form
DB2:

Select current timestamp from sysibm. sysdummy1 get system time
And
Select current date from sysibm. sysdummy1; get the date
Select current time from sysibm. sysdummy1; obtain the time

SQL Server:

Use getdate ()

SQL Server has very powerful date functions:

Select convert (varchar (100), getdate (), 0): 05 16 2008 AM
Select convert (varchar (100), getdate (), 1): 05/16/08
Select convert (varchar (100), getdate (), 2): 08.05.16
Select convert (varchar (100), getdate (), 3): 16/05/08
Select convert (varchar (100), getdate (), 4): 16.05.08
Select convert (varchar (100), getdate (), 5): 16-05-08
Select convert (varchar (100), getdate (), 6): 16 05 08
Select convert (varchar (100), getdate (), 7): 05 16, 08
Select convert (varchar (100), getdate (), 8): 10:57:46
Select convert (varchar (100), getdate (), 9): 05 16 2008 10: 57: 46: 827am
Select convert (varchar (100), getdate (), 10): 05-16-08
Select convert (varchar (100), getdate (), 11): 08/05/16
Select convert (varchar (100), getdate (), 12): 080516
Select convert (varchar (100), getdate (), 13): 16 05 2008 10: 57: 46: 937
Select convert (varchar (100), getdate (), 14): 10: 57: 46: 967
Select convert (varchar (100), getdate (), 20): 10:57:47
Select convert (varchar (100), getdate (), 21): 10:57:47. 157
Select convert (varchar (100), getdate (), 22): 05/16/08 10:57:47 AM
Select convert (varchar (100), getdate (), 23 ):
Select convert (varchar (100), getdate (), 24): 10:57:47
Select convert (varchar (100), getdate (), 25): 10:57:47. 250
Select convert (varchar (100), getdate (), 100): 05 16 2008 AM
Select convert (varchar (100), getdate (), 101): 05/16/2008
Select convert (varchar (100), getdate (), 102): 2008.05.16
Select convert (varchar (100), getdate (), 103): 16/05/2008
Select convert (varchar (100), getdate (), 104): 16.05.2008
Select convert (varchar (100), getdate (), 105): 16-05-2008
Select convert (varchar (100), getdate (), 106): 16 05 2008
Select convert (varchar (100), getdate (), 107): 05 16,200 8
Select convert (varchar (100), getdate (), 108): 10:57:49
Select convert (varchar (100), getdate (), 109): 05 16 2008
10: 57: 49: 437am ......

MySQL:

Select now ();
Output 09-12-25

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.