| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for a field width, which defaults to 9 if unspecified or
zero. If the width is not exactly 9, we have to either cut off digits
or append zeroes to make up the difference. If the width is a dash,
we pick a width based on the clock's reported resolution. This brings
us in line with GNU coreutils.
PR: 287080
MFC after: 1 week
Reviewed by: 0mp
Differential Revision: https://reviews.freebsd.org/D53667
(cherry picked from commit 38839c872e7af6a1424009bf07d6b4450e9ca61d)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Don't use `asprintf()` when `strdup()` can do the job just as well.
* Fix a couple of typos in a comment.
Fixes: eeb04a736cb9
MFC after: 3 days
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D46533
(cherry picked from commit a8ddd1926a34fc20970d9ceaad71b31fc414b1c5)
date: Documentation nits.
* Fix spurious capitalization.
* Fix inconsistent quoting.
* Use `Dq` rather than ASCII double quotes.
MFC after: 3 days
Sponsored by: Klara, Inc.
Reviewed by: 0mp
Differential Revision: https://reviews.freebsd.org/D46622
(cherry picked from commit 355ebf80b1ed98cf7ca9c51ce7e3e6dcb376853d)
|
| |
|
|
|
|
|
|
| |
X-MFC-With: 7b390cb63689
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44982
(cherry picked from commit dafb424b8d44c7fdc9cfe876a79aad05c438def0)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The tests related to nanosecond support were failing on amd64 due to
uninitialized timespec structure.
Fixes: eeb04a736cb9 date: Add support for nanoseconds
Reviewed by: markj
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D44975
(cherry picked from commit 7b390cb636899582243e4daa8edbdb30d686d9fb)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces support for a conversion specification for
nanoseconds.
The format of %N is meant to be compatible with that of GNU date.
The nanoseconds conversion specification is implemented directly in
date(1) instead of libc (in strftime(3)) to avoid introducing
non-standard functions to libc at this time and modifying struct tm.
Apart from introducing the nanoseconds conversion specification, this
patch brings the following changes:
- The "ns" format for ISO 8061 dates is now unlocked. E.g., date -Ins
prints:
2024-04-22T12:20:28,763742224+02:00
- The -r flag when fed a file is now aware of the nanosecond part of the last
modification time.
- date(1) is now able to set the time with nanosecond precision. It is
not possible as of now to do that by specifying nanoseconds directly
via the command-line arguments. Instead, the -r flag can be used.
- date(1) is now using the clock_gettime(3) family of functions instead
of ctime(3) family of functions where possible.
Reviewed by: des, markj
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D44905
(cherry picked from commit eeb04a736cb9c07d191af886e25d5f198824658e)
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
|
|
|
|
| |
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Inpired by OpenBSD date(1), this option allows to do timezone conversion
via the date(1) command.
For example, to determine when the BSDCan livestream begins for me:
$ env -i TZ=EST5EDT date -z Europe/Paris -j 0900
MFC After: 1 week
Reviewed by: kib, bcr (manpage)
Differential Revision: https://reviews.freebsd.org/D40159
|
| |
|
|
|
|
|
|
| |
This makes it consistent with other date(1) implementations. Also, it
feels more consistent since hours and minutes are already represented as
HH and MM respectively.
MFC after: 3 days
|
| |
|
|
| |
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
| |
Since D19668 was done, new users of the -n flag have surfaced. Parse
and ignore it on the command line until they can be updated.
Suggested by: rgrimes (in D19668).
Notes:
svn path=/head/; revision=346624
|
| |
|
|
|
|
|
|
|
|
| |
r342139 bork setting the date. This fixes it by simply removing the -n
flag.
Differential Revision: https://reviews.freebsd.org/D19668
Notes:
svn path=/head/; revision=345365
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
These were used to set dst flag and minutes west of UTC
respectively. These are obsolete and have been removed form the
kernel. These existed primarily to faithfully emulate early
Unix ABIs that have been removed from FreeBSD.
Reviewed by: jbh@, brooks@
Differential Revision: https://reviews.freebsd.org/D19550
Notes:
svn path=/head/; revision=345050
|
| |
|
|
|
|
|
|
|
|
| |
Submitted by: Kyle Spiers ksspiers at gmail
Reviewed by: bcr,brooks,bz,sbruno
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D18505
Notes:
svn path=/head/; revision=342139
|
| |
|
|
|
|
|
|
| |
The new flag is named '-I'. It is documented in the manual page and covered
by basic unit tests.
Notes:
svn path=/head/; revision=337332
|
| |
|
|
|
|
|
|
|
| |
we shouldn't leak stack garbage into the field.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=328282
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
Notes:
svn path=/head/; revision=326025
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
localtime(3) returns NULL when passed an invalid time_t but date(1)
previously did not handle it. Exit with an error in that case.
PR: 220828
Reported by: Vinícius Zavam
Reviewed by: cem, kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11660
Notes:
svn path=/head/; revision=321293
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.
Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96
Notes:
svn path=/head/; revision=314436
|
| |
|
|
|
|
|
|
|
|
|
|
| |
interpreted as a number, which checks the file's modification time and
use that as the date/time value.
This improves compatibility with GNU coreutils's version of time(1).
MFC after: 2 weeks
Notes:
svn path=/head/; revision=282608
|
| |
|
|
|
|
|
|
|
|
| |
As stated in the man page, this is equivalent to use "%a, %d %b %Y %T %z"
as the output format while LC_TIME is set to the "C" locale.
This is compatible with date(1) from the GNU core utilities.
Notes:
svn path=/head/; revision=264968
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This structure is not part of POSIX. According to POSIX, gettimeofday()
has the following prototype:
int gettimeofday(struct timeval *restrict tp, void *restrict tzp);
Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is
not used). Remove dead error handling code. Also use NULL for a
nul-pointer instead of integer 0.
While there, change all pieces of code that only use tv_sec to use
time(3), as this provides less overhead.
Notes:
svn path=/head/; revision=239991
|
| |
|
|
|
|
|
|
| |
date: use libc utmpx routines instead of the ones provided by libulog.
pax: don't depend on <utmp.h>
Notes:
svn path=/head/; revision=202193
|
| |
|
|
|
|
|
|
| |
utmpx also has OLD_TIME/NEW_TIME messages, which seem to be intended for
the same purpose as how we call logwtmp() here.
Notes:
svn path=/head/; revision=200157
|
| |
|
|
|
|
|
|
|
|
| |
date via -f %s).
Reported by: Eugene Grosbein
Diagnosed by: Miguel Lopes Santos Ramos
Notes:
svn path=/head/; revision=176094
|
| |
|
|
| |
Notes:
svn path=/head/; revision=139969
|
| |
|
|
|
|
|
| |
OK'ed by: imp, core
Notes:
svn path=/head/; revision=127958
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
in the comment applies to a decision that needs to be made in relation
to the year 2000.
In fact, that statement probably should be changed to be
more generic (getting the year from the current time perhaps). Otherwise,
starting in 2069 two digit year conversions in date(1) will start assuming
1900 instead of 2000. hehe.
Notes:
svn path=/head/; revision=126605
|
| |
|
|
| |
Notes:
svn path=/head/; revision=120729
|
| |
|
|
|
|
|
| |
udp/timed -> timed/udp
Notes:
svn path=/head/; revision=110390
|
| |
|
|
| |
Notes:
svn path=/head/; revision=105396
|
| |
|
|
| |
Notes:
svn path=/head/; revision=99109
|
| |
|
|
| |
Notes:
svn path=/head/; revision=91079
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.
Approved by: arch@, new style(9)
Notes:
svn path=/head/; revision=90108
|
| |
|
|
|
|
|
| |
MFC after: 1 day
Notes:
svn path=/head/; revision=85615
|
| |
|
|
|
|
|
|
| |
PR: 27986
Submitted by: Cyrille Lefevre <clefevre@redirect.to>
Notes:
svn path=/head/; revision=77934
|
| |
|
|
|
|
|
|
|
| |
PR: bin/27399
Submitted by: "Crist J. Clark" <crist.clark@globalstar.com>
MFC after: 3 days
Notes:
svn path=/head/; revision=76749
|
| |
|
|
|
|
|
| |
unistd.h, which is already included.
Notes:
svn path=/head/; revision=64692
|
| |
|
|
|
|
|
|
|
|
|
| |
option already supported octal. Add a comment to the -r option
in the man page so it's a bit more specific.
Discrepancy brought to my attention by: sasdrq@unx.sas.com
Approved by: jkh
Notes:
svn path=/head/; revision=63761
|
| |
|
|
|
|
|
|
|
|
|
|
| |
date is launched with the "u" argument. It now operates in the documented
manner.
Fix typo in date man page.
Submitted by: David McNett <nugget@slacker.com>
Notes:
svn path=/head/; revision=60718
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from the source attributed below. In particular, this removes a goto
inside a switch and replaces those horrendous ATOI macros with
something acceptable.
More clean-ups to come.
PR: bin/14151
Reported by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
Obtained from: NetBSD
Notes:
svn path=/head/; revision=55225
|
| |
|
|
|
|
|
|
| |
PR: 14472
Reported by: j_guojun@lbl.gov (Jin Guojun)
Notes:
svn path=/head/; revision=53082
|
| |
|
|
| |
Notes:
svn path=/head/; revision=50471
|
| |
|
|
| |
Notes:
svn path=/head/; revision=48214
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
add a -j flag that tells date not to try to set the date. This allows you
to use date as a userland interface to strptime.
example:
TZ=GMT date -j -f "%a, %d %b %Y %T %Z" "Sun, 08 Nov 1998 02:22:20 GMT" +%s
which is the standard format for Last-modified headers in HTTP requests.
only one to respond: eivind
Notes:
svn path=/head/; revision=47129
|
| |
|
|
|
|
|
|
| |
PR: 6308
Submitted by: Max Euston <meuston@jmrodgers.com>
Notes:
svn path=/head/; revision=44598
|
| |
|
|
| |
Notes:
svn path=/head/; revision=39925
|
| |
|
|
| |
Notes:
svn path=/head/; revision=36006
|
| |
|
|
| |
Notes:
svn path=/head/; revision=35773
|
| |
|
|
| |
Notes:
svn path=/head/; revision=32756
|