Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/bin/rc/tjd

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

rfork e

out=echo
post=(sed 's/(^[0-9]+)\.[0-9]+$/\1/')

flagfmt='n,l'
if (! ifs=() eval `{aux/getflags $*}) {
	echo 'usage: '$0' [-nl] [seconds]' >[1=2]
	exit usage
}

if (! ~ $flagn '')
	out=(echo -n)
if (! ~ $flagl '')
	post=cat

if (~ $#* 0)
	secs=`{date -n}
if not
	secs=$1

# julian day for unix epoch + time since unix epoch - tjd offset from julian day.
today=`{hoc -e '2440587.5 + ( '$secs' / ( 60*60*24)) - 2440000.5' | $post}
$out $today

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.