Project

General

Profile

Actions

Feature #5642

closed

want BSD-like date -r option

Added by Alexander Pyhalov over 8 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
2015-02-19
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

In FreeBSD date there's "-r" option to convert seconds since the Epoch to current date. It would be nice to have this option in illumos date.


Related issues

Is duplicate of illumos gate - Feature #8893: Want date -rClosedRobert Mustacchi2017-12-05

Actions
Actions #1

Updated by Paul Henson over 8 years ago

GNU coreutils (as used by most Linux distributions) uses -r for:

-r, --reference=FILE
display the last modification time of FILE

$ date -r /etc/hosts
Tue Jan 6 18:21:09 PST 2015

The behavior you mention is available under Linux with the syntax:

$ date --date='@1444666647'
Mon Oct 12 09:17:27 PDT 2015

No opinion on adding this to illumos, just pointing out however it's done it will be incompatible with another common OS.

Actions #2

Updated by Joshua M. Clulow over 8 years ago

Mac OS X, at least in Yosemite (10.10.2), includes a FreeBSD-compatible -r flag.

$ uname -a
Darwin leftbook.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
$ date -r 0
Wed 31 Dec 1969 16:00:00 PST
$ date -r 1000000000
Sat  8 Sep 2001 18:46:40 PDT
Actions #3

Updated by Robert Mustacchi almost 4 years ago

Actions #4

Updated by Robert Mustacchi almost 4 years ago

  • Category set to cmd - userland programs
  • Status changed from New to Closed
  • Assignee set to Robert Mustacchi
  • Tags deleted (needs-triage)

This was implemented in 8893 in a way that basically provides support for both variants as per other systems.

Actions

Also available in: Atom PDF