Guest User

Untitled

a guest
May 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. class Converter {
  2.  
  3. @TypeConverter
  4. fun fromTimestamp(value: Long?): Date? {
  5. return if (value == null) null else Date(value)
  6. }
  7.  
  8. @TypeConverter
  9. fun dateToTimestamp(date: Date?): Long? {
  10. return date?.time
  11. }
  12. }
Add Comment
Please, Sign In to add comment