- call time() only once
Merge pull request #20 from hadfl/localtime

- call time() only once