diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-03-04 08:44:36 +1100 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-03-04 08:44:36 +1100 |
commit | f63172c57ad5810153e792f86aa20bf418a6a78d (patch) | |
tree | 6988c2b4401163d327952fdbc7b9fb724795e5a2 | |
parent | 9a4982c17d02b0ab299e5d67cb7e2964bfe5ca44 (diff) | |
download | jimtcl-f63172c57ad5810153e792f86aa20bf418a6a78d.zip jimtcl-f63172c57ad5810153e792f86aa20bf418a6a78d.tar.gz jimtcl-f63172c57ad5810153e792f86aa20bf418a6a78d.tar.bz2 |
clock: test and doc non-Y2038 compliance
Add a note in the documentation for clock that some systems
use 32-bit time_t and are thus not year 2038 compliant.
Also add a test to catch this in clock.test
Reported-by: dbohdan <dbohdan@dbohdan.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | jim_tcl.txt | 3 | ||||
-rw-r--r-- | tests/clock.test | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/jim_tcl.txt b/jim_tcl.txt index 39c7984..b645549 100644 --- a/jim_tcl.txt +++ b/jim_tcl.txt @@ -1901,6 +1901,9 @@ clock See strptime(3) for supported formats. See `clock format` for the handling of '-gmt'. +*NOTE* Some systems such as 32-bit Linux have only a 32-bit time_t, and are therefore not year 2038 +compliant. + close ~~~~~ +*close* 'fileId'+ diff --git a/tests/clock.test b/tests/clock.test index 4e32df4..3e9aec3 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -51,4 +51,9 @@ test clock-4.1 {clock scan tests} clockscan { clock scan {Sun Nov 04 03:02:46 AM 1990} -format {%a %b %d %I:%M:%S %p %Y} -gmt true } 657687766 +# This will fail on systems that are not Y2038 compliant +test clock-5.1 {Year 2038 compliance} { + clock format 2200000000 -format %Y-%m-%dT%H:%M:%S -gmt true +} 2039-09-18T23:06:40 + testreport |