wjc
2025-05-07 b9cc7390e8e8ce64c41c26fb369c98ce669d660c
app/src/main/java/com/hdl/photovoltaic/utils/TimeUtils.java
@@ -110,7 +110,37 @@
     * 时间戳转时间(格式:yyyy-MM-dd HH:mm:ss)
     *
     * @param timestamp 时间戳
     * @param isDisplaySeconds 是否显示秒,true显示
     * @return -
     */
    public static String getTimeFromTimestamp(long timestamp, boolean isDisplaySeconds) {
        try {
            String pattern = "yyyy-MM-dd HH:mm:ss";
            if (isDisplaySeconds) {
                pattern = "yyyy-MM-dd HH:mm:ss";
                if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(LocalManageUtil.en)) {
                    pattern = "dd-MM-yyyy HH:mm:ss";
                }
            } else {
                pattern = "yyyy-MM-dd HH:mm";
                if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(LocalManageUtil.en)) {
                    pattern = "dd-MM-yyyy HH:mm";
                }
            }
            SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, getLocale());
            Date date = new Date(timestamp);
            return dateFormat.format(date);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "";
    }
    /**
     * 时间戳转时间(格式:yyyy-MM-dd HH:mm:ss)
     *
     * @param timestamp 时间戳
     *                  ¬     * @return -
     */
    public static String getTimeFromTimestamp(long timestamp) {
        try {
@@ -127,6 +157,7 @@
        return "";
    }
    /**
     * 时间戳转时间(格式:yyyy-MM-dd HH:mm:ss)
     *