Early knowledge of Daytime protocol

Source: Internet
Author: User
Tags printable characters

I don't know if you know such a protocol. It controls date queries and other content. Now let's take a look at the Daytime protocol. Daytime Protocol: Date query Protocol. Note: This time transfer protocol is widely used by small computers running MS-DOS and similar operating systems, the Protocol does not specify a fixed Transmission Format, only requests to send data according to ASCII standards.

Daytime Protocol (RFC867 Daytime Protocol)

This RFC standardizes an ARPA Internet community standard. All hosts on the ARPA Internet should adopt and implement this standard.

A useful measurement and debugging tool is the daytime service. It is used to return the current time and date in the string format.

* TCP-based daytime Service

The daytime service is a TCP-based application. The server listens on TCP port 13. Once a connection is established, it returns the date and time in the ASCII format (any received data is ignored ), close the connection after the transfer.

* UDP-based daytime Service

The daytime service can also use UDP protocol, and its port is also 13. However, UDP uses datagram to transmit the current time. the received data is ignored.

* Daytime protocol format

There is no specific format for daytime. We recommend that you use ASCII printable characters, space and carriage return line breaks. daytime should be on one line.

The following are two popular formats:

A popular format is: Weekday, Month Day, Year Time-Zone

Example: Tuesday, February 22,198 2 17:37:43-PST

Another popular format is used in SMTP: dd mmm yy hh: mm: ss zzz

Example: 02 FEB 82 07:59:01 PST

Note: For machines, useful Time uses the Time Protocol RFC-868)

Next, we use the VB program to set the time of our computer system through RFC867 protocol. to simplify the program, the program does not perform date correction, but only performs time correction. add a Winsock Control to FORM1 and paste the following code to the FORM1 code form:

Option Explicit

'Use RFC867 Daytime protocol to obtain standard time routines

'Www .time.ac.cn is the National Time Service Center of the Chinese Emy of sciences, using Beijing Time

'Time format: Mon Jul 26 09:58:57 2004

'Time .nist.gov is the American Institute of Standards and Technology and adopts Gyeonggi time

'Time format: 53212 04-07-26 02:00:12 50 0 488.3 UTC (NIST )*

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

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.