How does the client obtain the server time?

Source: Internet
Author: User
If you only get the date
Select current_date from sysibm. sysdummy1 or
Select curdate () from sysibm. sysdummy1

If you only get the time and the time precision is in seconds
Select current_time from sysibm. sysdummy1 or
Select curtime () from sysibm. sysdummy1
You can get the time

To be accurate to milliseconds or microseconds
Select current_timestamp from sysibm. sysdummy1
The obtained value is 2005-12-20-16.41.59.961520.

Sysibm. sysdummy1 is a table with only one row of records and belongs to the system table.
Usually similar to Oracle dual
Oracle usage
8i
Select to_char (sysdate, 'yyyy-mm-dd hh24: MI: ss') from dual can only be obtained in seconds
9i
Select systimestamp from dual; milliseconds can be obtained

SQL Server does not need to. You only need to select getdate () to obtain the millisecond.

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.