package com.rnboat.framework.util;

import android.util.Log;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class DateUtils {
    public static long getReBootTimeInterval() {
        long current = System.currentTimeMillis();
        long zero = (current / (1000 * 3600 * 24) * (1000 * 3600 * 24) - TimeZone.getDefault().getRawOffset());
        long rebootTimestamp = zero + 3 * 60 * 60 * 1000;
        if (System.currentTimeMillis() <= rebootTimestamp - 1 * 60 * 1000) {
            return rebootTimestamp - System.currentTimeMillis();
        }
        else {
            return (rebootTimestamp + 24 * 60 * 60 * 1000) - System.currentTimeMillis();
        }
    }

    public static String getFileName() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String date = format.format(new Date(System.currentTimeMillis()));
        return date;// 2012年10月03日 23:41:31
    }

    public static String getDateEN() {
        SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
        String date1 = format1.format(new Date(System.currentTimeMillis()));
        return date1;// 2012-10-03 23:41:31
    }

}
