fixed unix timestamp issue on windows

Generating unix timestamp using <em>time.time()</em> for greater portability. Also moved local variable <em>path_data</em> inside the else clause so as to avoid being referenced before assignment