date_from_ascatime (version 1.0)

You can also look at:
#! /usr/bin/perl

##############################################################################
#
# SYNTAX: date_from_ascatime ascatime 
#
# DESCRIPTION: This utility converts mission time to calendar date and time.
# DESCRIPTION: The date and time are written to stdout in 
# DESCRIPTION: "yyyy-mm-dd hh:mm:ss" format
#
# VERSION: 1.0
#
# HISTORY: 0.0 -> 1.0
# HISTORY: Converted from ksh to perl
#
# CALLS: $UTIL/read_parfile
# CALLS: $UTIL/fetch_file
# CALLS: $UTIL/setup_parfile
# CALLS: $UTIL/ftool_test
# CALLS: $FTOOL/sec2time
#
##############################################################################

$ascatime = $ARGV[0];

$UTIL = $ENV{"UTIL"};
$FTOOL = $ENV{"FTOOL"};
$PARFILE = $ENV{"PARFILE"};

##########################################
# Make sure we have the leap second table 
##########################################
chomp($leaptable = `$UTIL/read_parfile $PARFILE leaptable`);
chomp($caldir = `$UTIL/read_parfile $PARFILE caldir`);
`$UTIL/fetch_file $caldir $leaptable`;

##########################################
# Run sec2time to determine date and time 
##########################################
`$UTIL/setup_parfile $FTOOL/sec2time.par offset=$ascatime \\
                                         leapfile=$leaptable`;

`$FTOOL/sec2time >stdout.log 2>stderr.log`;
$code = $?;

chomp($date = `$UTIL/read_parfile sec2time.par date`);
chomp($time = `$UTIL/read_parfile sec2time.par time`);

`$UTIL/ftool_test sec2time $code $0 2 stdout.log stderr.log`;

#######################################
# Clip the decimal places off the time 
#######################################
$time =~ s/(.*)\..*$/$1/;

###################################################################
# For backwards compatibility convert old style dates to new style 
###################################################################
if ( "$date" =~ /(.+)\/(.+)\/(.+)/ ) {
     $date =  printf "19%02d-%02d-%02d", $3, $2, $1;
}

print "$date $time\n";

exit 0;