Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DateTypeConverter.java « db « adapters « sync « persistence « deck « nextcloud « niedermann « it « java « main « src « app - github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6b198a502eb65fbda9d67d2ab38639347246881e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package it.niedermann.nextcloud.deck.persistence.sync.adapters.db;

import androidx.room.TypeConverter;

import java.util.Date;

public class DateTypeConverter {

    @TypeConverter
    public static Date toDate(Long value) {
        return value == null ? null : new Date(value);
    }

    @TypeConverter
    public static Long toLong(Date value) {
        return value == null ? null : value.getTime();
    }
}