Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/bin/ksh
# This function takes a date time string of the format:
# YYYY MM DD HH MM SS
# perl autosplits the string and uses timelocal to return
# the number of seconds from the Epoch.
# No error checking!
function seconds_from_epoch {
echo $*| perl -MTime::Local -ane '
my $epochseconds = timelocal($F[5], $F[4], $F[3], $F[2], $F[1] - 1, $F[0]);
print "$epochseconds\n"; '
}
dt1=20120915
y1=$(echo "$dt1"|cut -c1-4)
m1=$(echo "$dt1"|cut -c5-6)
d1=$(echo "$dt1"|cut -c7-8)
s1=$(seconds_from_epoch "$y1 $m1 $d1 0 0 0")
echo $s1
dt2=20121017
y2=$(echo "$dt2"|cut -c1-4)
m2=$(echo "$dt2"|cut -c5-6)
d2=$(echo "$dt2"|cut -c7-8)
s2=$(seconds_from_epoch "$y2 $m2 $d2 0 0 0")
echo $s2