Skip to main content
1 of 2
Stéphane Chazelas
  • 586.8k
  • 96
  • 1.1k
  • 1.7k

With shell builtins:

  • zsh:

     $ zmodload zsh/datetime $ TZ=UTC0 strftime %c 1282368345 Sat 21 Aug 2010 05:25:45 UTC 
  • ksh93:

     $ TZ=UTC0 printf '%(%c)T\n' '#1282368345' Sat Aug 21 05:25:45 2010 
  • bash:

     $ TZ=UTC0 printf '%(%c)T\n' 1282368345 Sat 21 Aug 2010 05:25:45 UTC 

In all those, replace %c with the strftime() format you want.

Stéphane Chazelas
  • 586.8k
  • 96
  • 1.1k
  • 1.7k