Mattijn Mattijn - 1 year ago 98
Linux Question

How can I use date command in Linux to read ANSI date

ANSI date numbers starts from January 1st 1601 (day 1).
So how to get the following to work in a bash command in Linux?

I want:

# ANSI / UNIX epoch delta is 134774 days
$ date -ud ‘1601 -01 -01 + 134774 days ’ +%F
1970 -01 -01

But I get

date: invalid date '1601-01-01+134774 days'

Answer Source

To answer my own question as I meanwhile found this site:

It's because I'm on a 32-bit machine.

date -ud '1901-12-14 + 24855 days' +%F

will give

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download