{"id":13575645,"url":"https://github.com/ColumPaget/daytime","last_synced_at":"2025-04-04T22:31:43.951Z","repository":{"id":13955849,"uuid":"16656070","full_name":"ColumPaget/daytime","owner":"ColumPaget","description":"Aims to be a swiss-army-knife of setting system time. Supports setting time from http, nist time, daytime and (s)ntp protocols, and also from the command-line in a number of formats. Can also act as an (s)ntp server and (s)ntp broadcaster.","archived":false,"fork":false,"pushed_at":"2024-02-27T15:03:56.000Z","size":1821,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-05T11:43:30.721Z","etag":null,"topics":["c","cli","date","ntp","sntp","time"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ColumPaget.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-08T23:59:04.000Z","updated_at":"2024-02-27T15:02:19.000Z","dependencies_parsed_at":"2024-11-05T11:51:31.250Z","dependency_job_id":null,"html_url":"https://github.com/ColumPaget/daytime","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColumPaget%2Fdaytime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColumPaget%2Fdaytime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColumPaget%2Fdaytime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColumPaget%2Fdaytime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColumPaget","download_url":"https://codeload.github.com/ColumPaget/daytime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247260778,"owners_count":20910072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cli","date","ntp","sntp","time"],"created_at":"2024-08-01T15:01:02.888Z","updated_at":"2025-04-04T22:31:38.940Z","avatar_url":"https://github.com/ColumPaget.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"WHAT IS IT\n==========\n\tA program that gets time from daytime, nist daytime, time, SNTP/NTP, ssh, http or https  servers, and optionally updates the system and/or hardware clocks. It can also act as an SNTP server in its own right, or set date and time from the command-line using a number of different date and time formats.\n\nAUTHOR\n======\ndaytime and libUseful are (C) 2010 Colum Paget. They are released under the GPL so you may do anything with them that the GPL allows.\n\nEmail: colums.projects@gmail.com\nWebsite: www.cjpaget.co.uk\n\nDISCLAIMER\n==========\n  This is free software. It comes with no guarentees and I take no responsiblity if it makes your computer explode or opens a portal to the demon dimensions, though if it does the latter I'd like to be notified.\n\nINSTALL\n=======\nAfter unpacking the tar-ball:\n```\n    tar -zxf daytime-0.1.tar.gz\n```\n\nDo the usual './configure; make; make install'\n```\n    cd daytime-1.0\n    ./configure\n    make\n    make install\n```\n\n\nUSAGE\n=====\n\n```\n   daytime -daytime|-time|-nist|-http|-sntp \u003cserver\u003e [-s] [-r] [-tz \u003ctimezone\u003e]\n   daytime \u003curl\u003e [-s] [-r] [-tz \u003ctimezone\u003e]\n   daytime -sntp-bcast \u003cbroadcast net\u003e [-sntp-version \u003cversion\u003e]\n   daytime -sntpd [-sntp-stratum \u003cstratum\u003e] [-sntp-version \u003cversion\u003e]\n   daytime -S [date or time specifier]\n```\n\n\nOPTIONS\n=======\n\n```\n   -daytime\tGet time from daytime (RFC-867, port 13) server\n   -time\t\tGet time from time (RFC-868, port 123) server\n   -nist\t\tGet time from NIST daytime server\n   -http\t\tGet time from a web server\n   -sntp\t\tGet time from a SNTP server. (Not full NTP, only accurate to seconds). If server arg is 'bcast' then wait to recieve sntp broadcast.\n   -ntp \t\tGet time from a SNTP server. (Not full NTP, only accurate to seconds). If server arg is 'bcast' then wait to recieve sntp broadcast.\n   -sntp-bcast\tBroadcast SNTP Packets to supplied address. This arg can be used multiple times to bcast to multiple nets on a multihomed host\n   -sntp-version\tVersion of SNTP in packet. Some devices only accept '1' as the version in sntp broadcasts, when it should be '4'.\n   -sntp-stratum\tStratum of SNTP in packet. This is a measure of how many 'hops' away from an atomic clock an ntp server is. Defaults to '3'.\n   -sntpd\tin Daemon mode (implies -d) and provide an SNTP service.\n   -d\t\tDaemon mode. Background and stay running. Needed to recieve broadcast times\n   -D\t\tDaemon mode WITHOUT BACKGROUNDING.\n   -P\t\tPidfile path for daemon mode.\n   -t\t\tSleep time. Time between checks when in daemon mode, or between SNTP broadcasts (default 30 secs).\n   -s\t\tSet clock to time we got from server (requires root permissions).\n   -S\t\tSet clock from the command-line (requires root permissions).\n   -r\t\tSet hardware RTC clock\n   -v\t\tverbose output (mainly for SNTP mode)\n   -l\t\tsyslog significant events\n   -tz\t\tTimezone of remote host.\n   -servers\tList of some servers to try\n   -?\t\tThis help\n```\n\nThe -nist, -http, -sntp and -ntp optioons do not need a server argument, as they fall back to default servers.\n\nIf no server specified, http time from www.google.com will be tried first, then ntp from pool.ntp.org.\nServers can be specified as a host/port pair, like 'time.somewhere.com:8080'\n\n\nCommand-line set date/time.\n===========================\n\nThe '-S' switch allows setting a date or time from the command-line. This can be expressed in one of the following formats:\n\n```\n   HH:MM                -  time expressed in hours and minutes, date will stay as current.\n   HH:MM:SS             -  time expressed in hours, minutes and seconds, date will stay as current.\n   YYYY/mm/dd           -  date expressed in year, month, day. Time will stay as current. \n   dd/mm/YYYY           -  date expressed in year, month, day. Time will stay as current. \n   YYYY/mm/dd HH:MM:SS  -  date and time. \n   dd/mm/YYYY HH:MM:SS  -  date and time. \n   HH:MM:SS YYYY/mm/dd  -  date and time. \n   HH:MM:SS dd/mm/YYYY  -  date and time. \n   YYYY-mm-ddTHH:MM:SS  -  date and time. \n   YYYY/mm/ddTHH:MM:SS  -  date and time. \n   Sun Jan 20 15:55:37 GMT 2019   -  standard output of the 'date' command\n   Sun Jan 20 15:55:37 2019       -  'date' style without zone\n   Jan 20 15:55:37 GMT 2019       -  'date' style without day\n   Jan 20 15:55:37 2019           -  'date' style without day and zone\n```\n\nany character can be used as a separator in date, but time needs to use ':'\n\n\nSNTP Broadcasts and Daemon mode.\n================================\n\nReceiving the time as an SNTP broadcast requires having daytime stay running and wait for the message. To faciliate this a 'daemon mode' has been added. When -d or -D is used, daytime will stay running and do whatever it was told to do periodically. So:\n\n\n```\n\tdaytime -t 600 -d -sntp-bcast 192.168.1.255 -sntp-bcast 192.168.2.255\n```\n\n\nWill send sntp broadcasts of the current time to the networks 192.168.1.x and 192.168.2.x. The -t flag can be used to specify a time between broadcasts.\n\n```\n\tdaytime -s -d -sntp bcast\n```\n\nWill persist and wait to recieve sntp broadcasts and set the system time from them. NOTE -t cannot be used in sntp broadcast receive mode\n\n```\n\tdaytime -t 3600 -s -http www.google.com\n```\n\nWill check the time with google via http every hour, and set the system time to it\n\n\nSNTP Server\n===========\n\nthe -sntpd option will put daytime into SNTP server mode, where it will reply to SNTP requests on port 123. This can be combined with other actions, so for example:\n\n```\n\tdaytime -sntpd -sntp-bcast 192.168.2.255 -daytime time.somewhere.com -t 60\n```\n\nWill run as an SNTP server, updating time using daytime protocol to 'time.somewhere.com' every 60 seconds and sending sntp broadcasts every 60 seconds too\n\nThanks to Robert Crowley (http://tools.99k.org/) and Andrew Benton for bug reports\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FColumPaget%2Fdaytime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FColumPaget%2Fdaytime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FColumPaget%2Fdaytime/lists"}