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: 5605fe383c5cec4af0bc3efd0bd04809111261b7 (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 android.arch.persistence.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();
    }
}