encode timestamp as seconds