Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Nov 2019 13:03:25 +0100
From:      mj-mailinglist@gmx.de
To:        freebsd-questions@freebsd.org
Subject:   How to convert svn repository change date to epoch timestamp?
Message-ID:  <trinity-0e118d1a-6b7c-4c5e-a0b8-2b6fceb1e713-1572782605441@3c-app-gmx-bs36>

next in thread | raw e-mail | index | archive | help
Hi,

I am trying to convert the output of this command

svnlite info --show-item last-changed-date /usr/src/

to an epoch timestamp with base tools.

The output looks like this: 2019-11-03T07:11:09.005639Z

The date man page gives this example for converting dates:

date -j -f "%a %b %d %T %Z %Y" "`date`" "+%s"
(maybe add the info, that you have to use LC_TIME=C for this example to work)

I came up with this date format string "%Y-%m-%dT%H:%M:%SZ" but this
lacks the fractions part of the seconds.

Is this possible with the tools in base?

Or maybe i could chop of the second-fractions?

--
Martin




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?trinity-0e118d1a-6b7c-4c5e-a0b8-2b6fceb1e713-1572782605441>