Use more cross-platform way to pack time