mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
default timezone changed
This commit is contained in:
parent
80f1dc5821
commit
fcada6849b
1 changed files with 23 additions and 0 deletions
23
main.cpp
23
main.cpp
|
@ -23,6 +23,22 @@ int main() {
|
||||||
|
|
||||||
path blockchain_path {"/home/mwo/.bitmonero/lmdb"};
|
path blockchain_path {"/home/mwo/.bitmonero/lmdb"};
|
||||||
|
|
||||||
|
|
||||||
|
// change timezone to Universtal time zone
|
||||||
|
char old_tz[128];
|
||||||
|
const char *tz_org = getenv("TZ");
|
||||||
|
|
||||||
|
if (tz_org)
|
||||||
|
{
|
||||||
|
strcpy(old_tz, tz_org);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set new timezone
|
||||||
|
std::string tz = "TZ=Coordinated Universal Time";
|
||||||
|
putenv(const_cast<char *>(tz.c_str()));
|
||||||
|
tzset(); // Initialize timezone data
|
||||||
|
|
||||||
|
|
||||||
// enable basic monero log output
|
// enable basic monero log output
|
||||||
xmreg::enable_monero_log();
|
xmreg::enable_monero_log();
|
||||||
|
|
||||||
|
@ -61,5 +77,12 @@ int main() {
|
||||||
|
|
||||||
app.port(8080).multithreaded().run();
|
app.port(8080).multithreaded().run();
|
||||||
|
|
||||||
|
// set timezone to orginal value
|
||||||
|
if (tz_org != 0)
|
||||||
|
{
|
||||||
|
setenv("TZ", old_tz, 1);
|
||||||
|
tzset();
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue