package io.renren.modules.app.utils;

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

public class Tools {

    // 用于解决时差8小时问题
    private static String formDate(Date value) {
        String newValue = "null";
        try {
            SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
            if (value == null) {
                return "null";
            }
            Calendar ca = Calendar.getInstance();
            ca.setTime(value);
            ca.add(Calendar.HOUR_OF_DAY, 8);
            newValue = "\"" + f.format(ca.getTime()) + "\"";


        } catch (Exception e) {
            e.printStackTrace();
        }
        return newValue;
    }

}
