Date representation as YY/DDD or YYYY/DDD

Kirk Strauser kirk at
Wed Jun 3 21:07:17 UTC 2009

On Wednesday 03 June 2009 04:03:14 pm Polytropon wrote:

> I'm looking to an existing way to output a date in the format
> YY/DDD, where YY is the year (last two digits) and DDD is the
> of the year, starting from 1, preceeded by zeroes if needed,
> and YYYY/DDD, where YYYY is the year with four digits, such
> as 2009-01-01 would be 09/001, 2009-02-01 would be 2009/032.

Like this?

$ date +'%y/%j'
$ date +'%Y/%j'
Kirk Strauser

More information about the freebsd-questions mailing list