All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.codingapi.springboot.framework.utils.FullDateFormatUtils Maven / Gradle / Ivy

There is a newer version: 3.3.12
Show newest version
package com.codingapi.springboot.framework.utils;


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

public class FullDateFormatUtils {
    private final static SimpleDateFormat defaultFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    static {
        defaultFormat.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
    }

    public static String convert(long timestamp){
        return convert(new Date(timestamp));
    }

    public static String convert(Date date){
        return defaultFormat.format(date);
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy