Sha256: e42e55e66a137a0d6f79ace571f693c59ef76ccc2359cc97d4730262a3ba1234

Contents?: true

Size: 627 Bytes

Versions: 164

Compression:

Stored size: 627 Bytes

Contents

var Sntp = require('../lib');

// All options are optional

var options = {
    host: 'nist1-sj.ustiming.org',  // Defaults to pool.ntp.org
    port: 123,                      // Defaults to 123 (NTP)
    resolveReference: true,         // Default to false (not resolving)
    timeout: 1000                   // Defaults to zero (no timeout)
};

// Request server time

Sntp.time(options, function (err, time) {

    if (err) {
        console.log('Failed: ' + err.message);
        process.exit(1);
    }

    console.log(time);
    console.log('Local clock is off by: ' + time.t + ' milliseconds');
    process.exit(0);
});

Version data entries

164 entries across 142 versions & 18 rubygems

Version Path
ilog-0.4.1 node_modules/sntp/examples/time.js
ilog-0.4.0 node_modules/sntp/examples/time.js
ilog-0.3.3 node_modules/sntp/examples/time.js
ela-4.1.6 node_modules/sntp/examples/time.js
ela-4.1.5 node_modules/sntp/examples/time.js
ela-4.1.4 node_modules/sntp/examples/time.js
ela-4.1.3 node_modules/sntp/examples/time.js
optimacms-0.4.3 spec/dummy/node_modules/sntp/examples/time.js
optimacms-0.4.2 spec/dummy/node_modules/sntp/examples/time.js
ela-4.1.2 node_modules/sntp/examples/time.js
ela-4.1.1 node_modules/sntp/examples/time.js
ela-4.1.0 node_modules/sntp/examples/time.js
locomotivecms-3.4.0 app/javascript/node_modules/sntp/examples/time.js
ela-4.0.0 node_modules/sntp/examples/time.js
ela-3.4.3 node_modules/sntp/examples/time.js
ela-3.4.2 node_modules/sntp/examples/time.js
ela-3.4.0 node_modules/sntp/examples/time.js
ela-3.3.1 node_modules/sntp/examples/time.js
ela-3.3.0 node_modules/sntp/examples/time.js
ela-3.2.0 node_modules/sntp/examples/time.js