package cn.minbb.iot.util;

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

public class Application {

    private Application() {
    }

    private static Application application;

    public static Application getApplication() {
        if (application == null) {
            // 线程安全
            synchronized (Application.class) {
                application = new Application();
            }
        }
        return application;
    }

    // 获取系统当前时间
    public static String getCurrentStringTime() {
        return SimpleDateFormat.getDateTimeInstance().format(getCurrentDateTime());
    }

    public static Date getCurrentDateTime() {
        return new Date();
    }
}
