From 0882ffc1e3480feb3c067c1f8c961fc384de17e9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 22 Dec 2015 20:54:18 +0200 Subject: Print repository timestamps on the About page --- brep/mod-repository-details.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/brep/mod-repository-details.cxx b/brep/mod-repository-details.cxx index a1a0fa5..18da188 100644 --- a/brep/mod-repository-details.cxx +++ b/brep/mod-repository-details.cxx @@ -4,11 +4,18 @@ #include +#include // tzset() + +#include +#include // max() + #include #include #include +#include + #include #include #include @@ -22,6 +29,7 @@ #include #include +using namespace std; using namespace odb::core; using namespace brep::cli; @@ -37,6 +45,8 @@ init (scanner& s) options_->root (dir_path ("/")); db_ = shared_database (*options_); + + tzset(); // To use butl::to_stream() later on. } bool brep::repository_details:: @@ -100,6 +110,15 @@ handle (request& rq, response& rs) if (r.email) s << P << A(HREF="mailto:" + *r.email) << *r.email << ~A << ~P; + + ostringstream o; + butl::to_stream (o, + max (r.packages_timestamp, r.repositories_timestamp), + "%Y-%m-%d %H:%M:%S%[.N] %Z", + true, + true); + + s << P << o.str () << ~P; } t.commit (); -- cgit v1.1