| /freebsd-src/contrib/ntp/libntp/ |
| H A D | clocktime.c | 2 * clocktime - compute the NTP date from a day of year, hour, minute 21 * change when we are already less than a half year from the receive 22 * time stamp. Since the length of a year is variable we use a 35 * Take a time spec given as day-of-year, hour, minute and second as 37 * '*ts_ui'. The value will be in the range (rec_ui-0.5yrs) to 38 * (rec_ui+0.5yrs). A hint for the current start-of-year will be 42 * '*yearstart' will receive the associated start-of-year. 45 * (+/-4hrs) around the receive time by returning a non-zero value. 49 * 32-bit arithmetic. 53 int yday , /* day-of-year */ in clocktime() [all …]
|
| H A D | ntp_calendar.c | 2 * ntp_calendar.c - calendar and helper functions 7 * -------------------------------------------------------------------- 17 * constant-divider case. 61 * macros are not defined, check a few well-known compiler/architecture 63 * integers is unknown and shift-arithmetic-right is not available. 92 *--------------------------------------------------------------------- 94 *--------------------------------------------------------------------- 124 *--------------------------------------------------------------------- 126 *--------------------------------------------------------------------- 137 * true, though -- On 8bit CPUs or machines without barrel in int32_sflag() [all …]
|
| H A D | ymd2yd.c | 2 * ymd2yd - compute the date in the year from y/m/d 19 * elapsed days since the start of the given year and convert in ymd2yd() 20 * back to unity-based day in year. in ymd2yd() 25 return ntpcal_edate_to_yeardays(y-1, m-1, d-1) + 1; in ymd2yd()
|
| H A D | ntp_calgps.c | 2 * ntp_calgps.c - calendar for GPS/GNSS based clocks 7 * -------------------------------------------------------------------- 26 * misc. helpers -- might go elsewhere sometime? 37 /* calculate 'lfp - ofs' as '(l_fp)(-ofs) + lfp': negating a in ntpfp_with_fudge() 40 ofs = -ofs; in ntpfp_with_fudge() 52 /* -------------------------------------------------------------------- 55 * alike) it does not really pay off to do a floor-corrected division 57 * -------------------------------------------------------------------- 66 if (datum->secs >= limit) { in _norm_ntp_datum() 68 ++datum->days; in _norm_ntp_datum() [all …]
|
| /freebsd-src/contrib/ntp/include/ |
| H A D | ntp_calendar.h | 2 * ntp_calendar.h - definitions for the calendar time-of-day routine 13 uint16_t year; /* year (A.D.) */ member 14 uint16_t yearday; /* day of year, 1 = January 1 */ 27 uint16_t year; /* year (A.D.) */ member 28 uint8_t week; /* 1..53, week in year */ 54 * days-of-week 83 * We deal in a 4 year cycle starting at March 1, 1900. We assume 91 #define DAYSPERYEAR (365) /* days per year */ 96 #define SECSPERYEAR (365 * SECSPERDAY) /* regular year */ 97 #define SECSPERLEAPYEAR (366 * SECSPERDAY) /* leap year */ [all …]
|
| /freebsd-src/contrib/tzdata/ |
| H A D | leapseconds.awk | 1 # Generate zic format 'leapseconds' from NIST/IERS format 'leap-seconds.list'. 7 # timestamps this program works only to the year 2216, which is the 8 # year 1900 plus 10**10 seconds. However, in practice 9 # POSIX-conforming awk implementations invariably use IEEE-754 double 10 # and so support exact integers through 2**53. By the year 2216, 12 # timestamps this program should be good until the year 285,428,681 13 # (the year 1900 plus 2**53 seconds). By then leap seconds will be 23 print "# This file is generated automatically from the data in the public-domain" 24 print "# NIST/IERS format leap-seconds.list file, which can be copied from" 25 print "# <https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list>" [all …]
|
| /freebsd-src/usr.sbin/fifolog/lib/ |
| H A D | getdate.y | 13 ** Poul-Henning Kamp <phk@FreeBSD.org> 50 ** Daylight-savings mode: on, off, or not yet known. 57 ** Meridian: am, pm, or 24-hour style. 163 yyTimezone = - ($4 % 100 + ($4 / 100) * 60); 177 yyTimezone = - ($6 % 100 + ($6 / 100) * 60); 226 /* ISO 8601 format. yyyy-mm-dd. */ 228 yyMonth = -$2; 229 yyDay = -$3; 232 /* e.g. 17-JUN-1992. */ 235 yyYear = -$3; [all …]
|
| /freebsd-src/contrib/libarchive/libarchive/ |
| H A D | archive_getdate.c | 4 * This is a plain C recursive-descent translation of an old 5 * public-domain YACC grammar that has been used for parsing dates in 6 * very many open-source projects. 47 /* Daylight-savings mode: on, off, or not yet known. */ 78 time_t Year; member 85 * seconds, month/year are counted in months. */ 103 if (gds->tokenp[0].token == tUNUMBER in timephrase() 104 && gds->tokenp[1].token == ':' in timephrase() 105 && gds->tokenp[2].token == tUNUMBER in timephrase() 106 && gds->tokenp[3].token == ':' in timephrase() [all …]
|
| /freebsd-src/usr.bin/find/ |
| H A D | getdate.y | 74 ** Daylight-savings mode: on, off, or not yet known. 81 ** Meridian: am, pm, or 24-hour style. 169 yyTimezone = - ($4 % 100 + ($4 / 100) * 60); 183 yyTimezone = - ($6 % 100 + ($6 / 100) * 60); 232 /* ISO 8601 format. yyyy-mm-dd. */ 234 yyMonth = -$2; 235 yyDay = -$3; 238 /* e.g. 17-JUN-1992. */ 241 yyYear = -$3; 264 yyRelSeconds = -yyRelSeconds; [all …]
|
| /freebsd-src/contrib/ntp/scripts/monitoring/ |
| H A D | timelocal.pl | 4 ;# $time = timelocal($sec,$min,$hours,$mday,$mon,$year,$junk,$junk,$isdst); 5 ;# $time = timegm($sec,$min,$hours,$mday,$mon,$year); 8 ;# with localtime() and gmtime(). We manage this by caching the start times 9 ;# of any months we've seen before. If we know the start time of the month, 10 ;# we can always calculate any time within the month. The start times 30 $tzmin = 24 * 60 - $tzmin; # minutes west of GMT 31 $tzmin -= 24 * 60 if $epoch[5] == 70; # account for the date line 46 $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS; 54 $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS 55 + $tzmin * $MIN - 60 * 60 * ($_[8] != 0); [all …]
|
| /freebsd-src/lib/libcalendar/ |
| H A D | calendar.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 37 * For each month tabulate the number of days elapsed in a year before the 38 * month. This assumes the internal date representation, where a year 40 * But we do need a special table for the year 1582, since 10 days are 60 static int firstweek(int year); 64 * March 1st of year zero. 73 * Compute the year by starting with an approximation not smaller in jdate() 75 * year which does not begin after ndays. in jdate() 81 idt.y--; in jdate() [all …]
|
| H A D | calendar.3 | 44 .Fn easterg "int year" "struct date *dt" 46 .Fn easterog "int year" "struct date *dt" 48 .Fn easteroj "int year" "struct date *dt" 58 .Fn week "int nd" "int *year" 63 starting at March 1st, year zero (i.e., 1 B.C.) and ending way beyond 64 year 100000. 99 provide conversions between the common "year, month, day" notation 102 The days are numbered from March 1st year 1 B.C., starting 104 year 1 B.C. 138 The two calendars differ by the definition of the leap year. [all …]
|
| /freebsd-src/sys/kern/ |
| H A D | subr_clock.c | 1 /*- 2 * SPDX-License-Identifier: BSD-3-Clause 60 error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); in sysctl_machdep_adjkerntz() 61 if (!error && req->newptr) in sysctl_machdep_adjkerntz() 77 /*--------------------------------------------------------------------* 86 (month_days[(m) - 1] + (m == FEBRUARY ? leapyear(y) : 0)) 96 * some recent year avoids lots of unnecessary loop iterations in conversion. 97 * recent_base_days is the number of days before the start of recent_base_year. 103 * Table to 'calculate' pow(10, 9 - nsdigits) via lookup of nsdigits. 113 * ( ((year % 4) == 0 && [all …]
|
| H A D | subr_fattime.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 4 * Copyright (c) 2006 Poul-Henning Kamp 28 * Convert MS-DOS FAT format timestamps to and from unix timespecs 33 * yyyyyyymmmmddddd (year - 1980, month, day) 54 * The conversion functions below cut time into four-year leap-year 63 * FAT timestamps have 7 bits for the year and starts at 1980, so 64 * they can represent up to 2107 which means that the non-leap-year 79 #define YEAR 365 /* Length of normal year */ macro 80 #define LYC (4 * YEAR + 1) /* Length of 4 year leap-year cycle */ [all …]
|
| /freebsd-src/usr.bin/calendar/ |
| H A D | calendar.1 | 45 .Bk -words 48 .Op . Ar mm Op . Ar year 52 .Op Fl U Ar UTC-offset 64 .Bl -tag -width Ds 87 This option requires super-user privileges. 112 .Op . Ar mm Op . Ar year 116 .It Fl U Ar UTC-offset 137 .Bl -tag -width 123456789012345 -compact 155 The first day of the Chinese year. 178 .Dq Paskha-4 . [all …]
|
| /freebsd-src/usr.bin/last/ |
| H A D | last.1 | 36 .Op Fl -libxo 64 hostname, the start and stop times for the session, and the duration 72 .Bl -tag -width indent-two 73 .It Fl -libxo 103 .Bl -tag -width Ds -compact -offset indent 105 The first two digits of the year (the century). 107 The second two digits of the year. 121 Month of the year, from 1 to 12. 137 year. 160 .Dq Li "last -t 03" [all …]
|
| /freebsd-src/contrib/tzcode/ |
| H A D | zic.8 | 2 .\" 2009-05-17 by Arthur David Olson. 11 .Op Fl -help 12 .Op Fl -version 27 .Op Fl t Ar localtime-link 39 .Dq "-" , 43 .Bl -tag -width indent 44 .It Fl -version 46 .It Fl -hel [all...] |
| /freebsd-src/contrib/ntp/clockstuff/ |
| H A D | chutest.c | 2 * chutest - test the CHU clock 84 * main - parse arguments and handle options 133 (void) fprintf(stderr, "usage: %s [-dft] tty_device\n", in main() 137 (void) fprintf(stderr, "usage: %s [-dft] tty_device\n", in main() 142 (void) fprintf(stderr, "usage: %s [-cdft] tty_device\n", in main() 168 * openterm - open a port to the CHU clock 236 * process_raw - process characters in raw mode 253 difftv.tv_sec = tv.tv_sec - lasttv.tv_sec; in process_raw() 254 difftv.tv_usec = tv.tv_usec - lasttv.tv_usec; in process_raw() 256 difftv.tv_sec--; in process_raw() [all …]
|
| /freebsd-src/contrib/ntp/ntpd/ |
| H A D | refclock_hopfser.c | 4 * - clock driver for hopf serial boards (GPS or DCF77) 53 #define PRECISION (-10) /* precision assumed (about 1 ms) */ 101 hopfserial_start, /* start up driver */ 111 * hopfserial_start - open the devices and initialize data for processing 129 fd = refclock_open(&peer->srcadr, gpsdev, SPEED232, LDISC_CLK); in hopfserial_start() 132 printf("hopfSerialClock(%d) start: open %s failed\n", unit, gpsdev); in hopfserial_start() 144 pp = peer->procptr; in hopfserial_start() 145 pp->unitptr = up; in hopfserial_start() 146 pp->io.clock_recv = hopfserial_receive; in hopfserial_start() 147 pp->io.srcclock = peer; in hopfserial_start() [all …]
|
| H A D | refclock_tsyncpci.c | 65 #define PRECISION (-20) /* precision assumed (1 us) */ 66 #define DESCRIPTION "Spectracom TSYNC-PCI" /* WRU */ 104 #define TSYNC_TIME_BASE_YEAR (1970) // earliest acceptable year 142 unsigned char syncOption; /* -M option */ 148 unsigned short year; member 188 unsigned int year; member 271 tsync_start, /* start up driver */ 313 * IN: unit - not used. 314 * *peer - pointer to this reference clock's peer structure 315 * Returns: 0 - unsuccessful [all …]
|
| H A D | refclock_chronolog.c | 2 * refclock_chronolog - clock driver for Chronolog K-series WWVB receiver. 26 * This driver supports the Chronolog K-series WWVB receiver. 33 * YY/MM/DD -- what you'd expect. This arrives a few seconds before the 35 * hh:mm:ss -- what you'd expect. We take time on the <cr>. 49 #define PRECISION (-13) /* precision assumed (about 100 us) */ 51 #define DESCRIPTION "Chrono-log K" /* WRU */ 56 * Chrono-log unit control structure 62 int year; /* Y2K-adjusted year */ member 63 int day; /* day-of-month */ 64 int month; /* month-of-year */ [all …]
|
| /freebsd-src/contrib/ntp/parseutil/ |
| H A D | dcfd.c | 2 …* /src/NTP/REPOSITORY/ntp4-dev/parseutil/dcfd.c,v 4.18 2005/10/07 22:08:18 kardel RELEASE_20051008… 14 * Leap second handling (at that level you should switch to NTP Version 4 - really!) 16 * Copyright (c) 1995-2015 by Frank Kardel <kardel <AT> ntp.org> 17 …* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Ge… 90 if ((_a_)->tv_usec >= 1000000) \ 92 (_a_)->tv_sec += (_a_)->tv_usec / 1000000; \ 93 (_a_)->tv_usec = (_a_)->tv_usec % 1000000; \ 95 if ((_a_)->tv_usec < 0) \ 97 (_a_)->tv_sec -= 1 + (-(_a_)->tv_usec / 1000000); \ 98 (_a_)->tv_usec = 999999 - (-(_a_)->tv_usec - 1); \ [all …]
|
| /freebsd-src/contrib/ntp/libparse/ |
| H A D | clk_rcc8000.c | 2 * /src/NTP/ntp4-dev/libparse/clk_rcc8000.c,v 4.9 2004/11/14 15:29:41 kardel RELEASE_20050508_A 6 * Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master Clock support 45 * DDD - Day of year number 46 * W - Day of week number (Sunday is 0) 52 { { { 13, 2 }, {16, 2}, { 19, 2}, /* Day, Month, Year */ 84 if (!Strok(buffer, format->fixed_string)) return CVT_NONE; in cvt_rcc8000() 85 #define OFFS(x) format->field_offsets[(x)].offset in cvt_rcc8000() 86 #define STOI(x, y) Stoi(&buffer[OFFS(x)], y, format->field_offsets[(x)].length) in cvt_rcc8000() 87 if ( STOI(O_DAY, &clock_time->day) || in cvt_rcc8000() 88 STOI(O_MONTH, &clock_time->month) || in cvt_rcc8000() [all …]
|
| H A D | clk_rawdcf.c | 2 …* /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_rawdcf.c,v 4.18 2006/06/22 18:40:01 kardel RELEASE_200… 8 * Copyright (c) 1995-2015 by Frank Kardel <kardel <AT> ntp.org> 9 …* Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universitaet Erlangen-Nuernberg, Ge… 60 * From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig 73 * see the spec. (basically a (non-)inverted psuedo random phase shift) 77 * 0 - 10 AM: free, FM: 0 78 * 11 - 14 free 79 * 15 R - "call bit" used to signalize irregularities in the control facilities 81 * 16 A1 - expect zone change (1 hour before) 82 * 17 - 18 Z1,Z2 - time zone [all …]
|
| /freebsd-src/contrib/ntp/scripts/stats/ |
| H A D | README.timecodes | 11 C on-time character (start bit) 12 Y year of century 14 D day of year or month/day 40 ddd = day of year 60 yy = year (as broadcast) 61 ddd = day of year 63 l = leap-second warning (L indicates leap at end of month) 75 TrueTime 468-DC Satellite Synchronized Clock (and other TrueTime 93 Heath GC-1000 Most Accurate Clock (WWV/H) 102 yy = year of century (from DIPswitches) [all …]
|