serialize to time