Give the most awesome example of how to parse the output of date

back into epoch time.  Everytime I'm asked to do this by someone I
have to spend about ten minutes recreating the same command line.
So record it under examples.
This commit is contained in:
Alfred Perlstein 2004-07-17 00:26:31 +00:00
parent 59f7a82d52
commit 8a0f7000e6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132272

View File

@ -328,6 +328,14 @@ The command:
sets the time to
.Li "2:32 PM" ,
without modifying the date.
.Pp
Finally the command:
.Pp
.Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`date`"" ""+%s"""
.Pp
can be used to parse the ouput from
.Nm
and express it in epoch time.
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm :