aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/gen_certs.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-12-01 14:59:01 +0000
committerlloyd <[email protected]>2009-12-01 14:59:01 +0000
commit9ffe4441271ff41fd33fc3965c191e62bce36453 (patch)
tree34ea31314e94c4d51271b9b09506a9aa03eff881 /doc/examples/gen_certs.cpp
parentf3c149bce5b5ddb527a072c2f34daaa993cdba94 (diff)
Update examples for changed/removed APIs, namely:
to_string -> std::to_string system_time -> std::chrono
Diffstat (limited to 'doc/examples/gen_certs.cpp')
-rw-r--r--doc/examples/gen_certs.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/examples/gen_certs.cpp b/doc/examples/gen_certs.cpp
index 80cb5f54a..557c6f46e 100644
--- a/doc/examples/gen_certs.cpp
+++ b/doc/examples/gen_certs.cpp
@@ -71,14 +71,14 @@ void save_pair(const std::string& name,
key_out.close();
}
+typedef std::chrono::duration<int, std::ratio<31556926>> years;
+
int main()
{
- const u32bit seconds_in_a_year = 31556926;
-
- const u32bit current_time = system_time();
+ auto current_time = std::chrono::system_clock::now();
X509_Time now = X509_Time(current_time);
- X509_Time later = X509_Time(current_time + 4*seconds_in_a_year);
+ X509_Time later = X509_Time(current_time + years(4));
LibraryInitializer init;