package keijumt.todoapp.data.db import android.arch.persistence.room.TypeConverter import java.util.* /** * Created by matsumoto_k on 2018/03/09. */ class DateConverter { @TypeConverter fun toDate(timestamp: Long?): Date? { return if (timestamp == null) null else Date(timestamp) } @TypeConverter fun toTimestamp(date: Date?): Long? { return date?.time?.toLong() } }