Fix UNIX timestamp calculation