#ifndef
is an instruction to part of the compiler (called the preprocessor) to only include the code if a symbol (in this case "WIN32") is not defined. Equally,
#ifdef
includes the code if the symbol is defined.
All it does is makes it possible to have one code file which can cope with different compilation circumstances.
The most common use is probably
#ifdef DEBUG
to only include tracing or logging statements if this is the test version rather than release. That way, when there is a problem, the same code gets tested with tracing code inserted, but without changing the source.
In the code fragment you show,
#ifddef WIN32
is there to let the code work the same with two different systems Time formats: Ubuntu and Windows (which handle it a little differently).