Use local time instead of UTC
Fix static definition madness

This is supposed to define functions as static only in non-debug builds.
In debug builds it's better not to have static functions to allow for
better tracing. Previously, not only static functions were affected, but
variables too.