/*
7 * Patrick Storz <eduard.braun2@gmx.de>
9 * Copyright (C) 2019 Authors
10 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
17#include <glibmm/ustring.h>
25 char *source_date_epoch = std::getenv(
"SOURCE_DATE_EPOCH");
26 if (source_date_epoch) {
27 std::istringstream iss(source_date_epoch);
29 if (iss.fail() || !iss.eof()) {
30 std::cerr <<
"Error: Cannot parse SOURCE_DATE_EPOCH as integer\n";
40 Glib::ustring now_formatted;
47 now_struct = gmtime(&
now);
48 if (strftime(buffer, 25,
"%Y-%m-%dT%H:%M:%S", now_struct)) {
49 now_formatted = buffer;
Glib::ustring now_iso_8601()
like ReproducibleBuilds::now() but returns a ISO 8601 formatted string
time_t now()
parse current time from SOURCE_DATE_EPOCH environment variable