FileDocCategorySizeDatePackage
DateAtHost.javaAPI DocExample885Thu Jul 03 16:23:46 BST 1997None

DateAtHost

public class DateAtHost extends Date

Fields Summary
static int
timePort
static final long
offset
Constructors Summary
public DateAtHost(String host, int port)

   //  Seconds from century to 
                                              //   Jan 1, 1970 00:00 GMT

	         
        Socket server = new Socket( host, port );
        DataInputStream din = new DataInputStream( server.getInputStream() );
        int time = din.readInt();
        server.close();
 
        setTime( (((1L << 32) + time) - offset) * 1000 );
	
public DateAtHost(String host)

		this( host, timePort );
	
Methods Summary
public static voidmain(java.lang.String[] args)

		System.out.println( new DateAtHost( args[0] ) );