Hi.
On 2023-03-04 05:40, Randy Merkel wrote:
> Just noticed the 2.11bsd's date is post 1999. How is that possible?
> Anyway to supply yyyy to the date command?
>
> Until then, using 1995 so that the weekdays and dates line up ;)
It's actually a bit more simple than that. If you give a year before
1970, it will assume it's in the 21st century.
So:
date 2303041328
means
2023-03-04 13:28
Before 2070 we need to fix this. ;-)
On 2023-03-05 04:17, Warner Losh wrote:
>
>
> On Sat, Mar 4, 2023 at 5:29 AM Johnny Billquist <b...@softjar.se
> <mailto:b...@softjar.se>> wrote:
>
> Hi.
>
> On 2023-03-04 05:40, Randy Merkel wrote:
> > Just noticed the 2.11bsd's date is post 1999. How is that possible?
> > Anyway to supply yyyy to the date command?
> >
> > Until then, using 1995 so that the weekdays and dates line up ;)
>
> It's actually a bit more simple than that. If you give a year before
> 1970, it will assume it's in the 21st century.
>
> So:
>
> date 2303041328
>
> means
>
> 2023-03-04 13:28
>
> Before 2070 we need to fix this. ;-)
>
>
> I don't think time_t has been bumped to 32-bits yet, has it? That puts the
> gotta do something about time date rather close, in 2036...
You guessed wrong.
From /usr/include/sys/types.h
typedef long time_t;
So it is 32 bits. However, unless I remember wrong, it is the 32-bit
time that will wrap in 2036. So we should go unsigned before then.