Commit a0a463e6 authored by Leigh Stoller's avatar Leigh Stoller

Add TBDateStringUTC for a more readable version of UTC time.

parent 83b11339
......@@ -33,7 +33,8 @@ use vars qw(@ISA @EXPORT);
TBDB_CHECKDBSLOT_ERROR TBcheck_dbslot TBFieldErrorString
TBGetUniqueIndex ParRun VersionInfo UpdateVersionInfo
SpanningTree GenFakeMac BackTraceOnWarning PassWordHash
SSHwithTimeout TBDateStringGMT TBDateStringLocal runBusyLoop
SSHwithTimeout TBDateStringGMT TBDateStringLocal TBDateStringUTC
runBusyLoop
MapEventType MapEventObjectType MapEventTriggerType ValidUUID
);
......@@ -855,6 +856,19 @@ sub TBDateStringLocal($)
}
return POSIX::strftime("20%y-%m-%d %H:%M:%S", localtime($date));
}
# Convert date to readable UTC
sub TBDateStringUTC($)
{
my ($date) = @_;
return ""
if (!defined($date) || "$date" eq "");
if ($date !~ /^\d+$/) {
$date = str2time($date);
}
return POSIX::strftime("20%y-%m-%d %H:%M UTC", gmtime($date));
}
sub isMounted($)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment