On Thursday 28 March 2002 01:03 pm, Bert Freudenberg wrote:
I just realised there is nothing to get 'Internet Time' in Squeak. If I write the code, what will I have to do to submit it for updation in the final image?
If it helps, this will do RFC868 (no error handling, etc.):
| s addr response time | s _ Socket new. addr _ NetNameResolver promptUserForHostAddress. s connectTo: addr port: 37. s waitForConnectionUntil: Socket standardDeadline. response _ ByteArray withAll: s getData. "from Jan 1 1900" time _ response unsignedLongAt: 1 bigEndian: true. time _ time - (365 * 24 * 60 * 60). "shift to 1901" (Time dateAndTimeFromSeconds: time) inspect