import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.net.Socket; import java.net.SocketException; import java.nio.ByteBuffer; import java.uti.Date; import java.util.Scanner; public class rDate{ public static void main(String[] args) throw IOException{ Scanner sc=new Scanner(System.in); String niz=sc.next(); try{ Socket s=new Socket(niz,37); OutputStreamWriter izhod=new OutputStreamWriter(s.getOutputStream()); InputStream vhod=s.getInputStream(); byte[] podatek=new byte[4]; ByteBuffer buf=ByteBuffer.wrap(podatek); int stevilka=buf.getInt(); long dolga=stevilka long maska=-1; maska =~(maska <<32); dolga = dolga & maska; Date d=new Date(dolga *1000 - 2208988800000L); System.out.print(d); izhod.write(d.toString()); }catch(SocketException e){ System.out.println("Strežnik ne obstaja"); } } }