miércoles, 17 de junio de 2009

Working with date in shell

If you don't know what time is the unix time 1245257034



Or in UTC


$ date -d @1245257034 -u
Wed Jun 17 16:43:54 UTC 2009


To know what is the current unix time in your machine

$ date +%s
1245257175

2 comentarios:

  1. can you post a function that returns a list of dates between a given range in iso format ? :D

    ResponderEliminar
  2. date +%s and date -u +%s are the same.

    man date(1):
    ...
    %s seconds since 1970-01-01 00:00:00 UTC <-- (always UTC)
    ...

    :P

    ResponderEliminar