From e9a910b33c7837b4b868e3abda18eb4810df7f02 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 4 Oct 2025 09:14:33 +0100 Subject: config/git: import suckless sbase i currently use the output of sha512sum in several places of xbmk, which is a bit unreliable in case output changes. other cases where i use util outputs in variables are probably reliable, because i'm using mostly posix utilities in those. to mitigate this, i now import suckless sbase, which has a reasonable sha512sum implementation. *every* binary it builds is being placed in build.list, because i'll probably start using more of them. for example, i may start modifying the "date" implementation, adding the GNU-specific options that i need as mentioned on init.sh i'm importing it in util/ because the sha512sum util is needed for verifying project sources, so if sbase itself is a "project source", that means we can into a chicken and egg bootstrapping problem. this is sbase at revision: 055cc1ae1b3a13c3d8f25af0a4a3316590efcd48 Signed-off-by: Leah Rowe --- util/sbase/date.1 | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 util/sbase/date.1 (limited to 'util/sbase/date.1') diff --git a/util/sbase/date.1 b/util/sbase/date.1 new file mode 100644 index 00000000..fb9fb31b --- /dev/null +++ b/util/sbase/date.1 @@ -0,0 +1,81 @@ +.Dd October 8, 2015 +.Dt DATE 1 +.Os sbase +.Sh NAME +.Nm date +.Nd print or set date and time +.Sh SYNOPSIS +.Nm +.Op Fl d Ar time +.Op Fl u +.Oo +.Cm + Ns Ar format | +.Sm off +.Ar mmddHHMM Oo Oo Ar CC Oc Ar yy Oc +.Sm on +.Oc +.Sh DESCRIPTION +.Nm +prints the date and time according to +.Xr locale 7 +or +.Ar format +using +.Xr strftime 3 +or sets the date. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl d Ar time +Print +.Ar time +given as the number of seconds since the +Unix epoch 1970-01-01T00:00:00Z. +.It Fl u +Print or set UTC time instead of local time. +.El +.Pp +An operand with a leading plus +.Pq Cm + +sign signals a user-defined format string using +.Xr strftime 3 +conversion specifications. +.Pp +An operand without a leading plus sign is interpreted as a value +for setting the system's current date and time. +The canonical representation for setting the date and time is: +.Pp +.Bl -tag -width Ds -compact -offset indent +.It Ar mm +The month of the year, from 01 to 12. +.It Ar dd +The day of the month, from 01 to 31. +.It Ar HH +The hour of the day, from 00 to 23. +.It Ar MM +The minute of the hour, from 00 to 59. +.It Ar CC +The first two digits of the year (the century). +.It Ar yy +The second two digits of the year. +If +.Ar yy +is specified, but +.Ar CC +is not, a value for +.Ar yy +between 69 and 99 results in a +.Ar CC +value of 19. +Otherwise, a +.Ar CC +value of 20 is used. +.El +.Pp +The century and year are optional. +The default is the current year. +.Sh STANDARDS +POSIX.1-2013. +.Pp +The +.Op Fl d +flag is an extension to that specification. -- cgit v1.2.1