Package net.time4j.clock
Class DaytimeClock
- All Implemented Interfaces:
TimeSource<Moment>
Represents a connection to a DAYTIME-server following the old norm RFC 867.
Note that the format of the server reply is not specified by the protocol. Furthermore, many internet time servers have stopped to support this old protocol. Actually in year 2014, at least the addresses "time.nist.gov" and "time.ien.it" are still working. Applications cannot expect more than second precision at best.
Note: This implementation is threadsafe.
- Since:
- 2.1
- Author:
- Meno Hochschild
-
Field Summary
Modifier and TypeFieldDescriptionstatic DaytimeClock
Defines an instance which supports the NIST-servers using the multiple-location-address "time.nist.gov" and a specific format. -
Constructor Summary
ConstructorDescriptionDaytimeClock(String server, ChronoParser<Moment> parser)
Creates a new instance which uses the given time server on the port 13. -
Method Summary
Modifier and TypeMethodDescriptionTries to get the raw server timestamp as original string.Methods inherited from class net.time4j.clock.NetTimeConnector
connect, currentTime, getLastConnectionTime, getLastOffsetInMicros, getNetTimeConfiguration, isLogEnabled, isRunning, reconfigure, setLogWriter
Methods inherited from class net.time4j.clock.AbstractClock
inLocalView, inPlatformView, inZonalView, inZonalView
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.time4j.base.TimeSource
currentInstant
-
Field Details
-
NIST
Defines an instance which supports the NIST-servers using the multiple-location-address "time.nist.gov" and a specific format.
The format is documented at www.nist.gov.
-
-
Constructor Details
-
DaytimeClock
Creates a new instance which uses the given time server on the port 13.
- Parameters:
server
- time server address (example: "time.nist.gov")parser
- object interpreting the server reply
-
-
Method Details
-
getRawTimestamp
Tries to get the raw server timestamp as original string.
- Returns:
- unparsed server reply
- Throws:
IOException
- if connection fails- Since:
- 2.1
-