timestamp = mktime(&tm) - _timezone;
or platform independent way:
timestamp = mktime(&tm) - timezone;
If you look in the source of mktime() on line 00117, the time is converted to local time:
seconds += _timezone;
More Related Contents:
- New to programming: How to call a structure’s variables in a function and then update them? (C++) [closed]
- How to extract a multiline text segment between two delimiters under a certain heading from a text file using C++ [closed]
- When and why will a compiler initialise memory to 0xCD, 0xDD, etc. on malloc/free/new/delete?
- Why is volatile not considered useful in multithreaded C or C++ programming?
- Most efficient way to compare a variable to multiple values?
- What does ‘unsigned temp:3’ in a struct or union mean? [duplicate]
- Will std::string always be null-terminated in C++11?
- C++ return array from function [duplicate]
- The differences between initialize, define, declare a variable
- Using newly declared variable in initialization (int x = x+1)?
- Change the current working directory in C++
- Does std::vector *have* to move objects when growing capacity? Or, can allocators “reallocate”?
- Compile the Python interpreter statically?
- Operator overloading outside class [duplicate]
- How to update a printed message in terminal without reprinting
- Do c++ templates make programs slow?
- Why doesn’t std::string provide implicit conversion to char*?
- Getting a vector into a function that expects a vector
- Understanding (simple?) C++ Partial Template Specialization
- What is the reason behind cbegin/cend?
- Class inherited from class without default constructor
- In C/C++, is char* arrayName[][] a pointer to a pointer to a pointer OR a pointer to a pointer?
- Is it more efficient to copy a vector by reserving and copying, or by creating and swapping? [duplicate]
- Macro / keyword which can be used to print out method name?
- Obtain container type from (its) iterator type in C++ (STL)
- Purpose of struct, typedef struct, in C++
- Two colours text in QPushButton
- How do I guarantee fast shutdown of my win32 app?
- Variable Sized Struct C++
- Why is this C++ wrapper class not being inlined away?