Serialize timestamp