|
Boost Testing : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2007-11-07 09:57:42
A number of our reports display the report time, usually as UTC.
While in theory this is fine, in practice I find it cumbersome to first
do the mental conversion to local time, then to the 12 hour clock time
I'm most comfortable with.
Is there a relatively easy and reliable way for Javascript, or some
other technology available in popular browsers, to display a time as
local time?
I looked on the web, but everything I found wanted me to take several
hours to learn far more about date processing than I want to know.
See below for typical code that would have to be converted, in this case
from compiler_status.html.
Thanks,
--Beman
------------
char run_date[128];
std::time_t tod;
std::time( &tod );
std::strftime( run_date, sizeof(run_date),
"%X UTC, %A %d %B %Y", std::gmtime( &tod ) );
std::string rev = revision( boost_root );
report << "<html>\n"
"<head>\n"
"<title>Boost Test Results</title>\n"
"</head>\n"
"<body bgcolor=\"#ffffff\" text=\"#000000\">\n"
"<table border=\"0\">\n"
"<tr>\n"
"<td><img border=\"0\" src=\"http://www.boost.org/boost.png\"
width=\"277\" "
"height=\"86\"></td>\n"
"<td>\n"
"<h1>Boost Test Results - " + platform_desc() + "</h1>\n"
"<b>Run</b> "
<< run_date;