当前位置:网站首页>[Method for converting timestamp to normal time format]
[Method for converting timestamp to normal time format]
2022-08-08 21:02:00 【child running in the sun】
I encountered the problem of converting the timestamp to the normal time format in the project, record it here:
public class DateUtil {public static String timeStamp2Date(String time){Long timeLong = Long.parseLong(time);SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//The time format to be convertedDate date;try {date = sdf.parse(sdf.format(timeLong));return sdf.format(date);} catch (ParseException e) {e.printStackTrace();return null;}}} Method call
String time = DateUtil.timeStamp2Date(result.getString("WEATHER_DATE"))Thanks for reading.
边栏推荐
猜你喜欢

单片机--IIC总线篇

The new library online | CnOpenDataA shares of the listed company basic information data

目标检测论文 Precise detection of Chinese characters in historical documents with DRL
Flask 教程 第十二章:日期和时间

昇腾Ascend 随记 —— 昇腾 AI 的基本架构

jmeter简单压测

【线性代数04】投影矩阵P和标准正交矩阵Q
Flask 教程 第四章:数据库

【highcharts应用-双饼图】

Everything原理探究以及C#实现
随机推荐
语义分割FCN FPN UNet DeepLab HRNet SETR TransFuse...
【highcharts应用-双饼图】
numpy
安全策略及电商购物订单简单用例
Notes: The difference between laravel, updateOrCreate and updateOrInsert
关于Mac终端自定义命令和Mysql命令问题
fashion CNNs code
amd和Intel的CPU到底哪个好?
Flask 教程 第五章:用户登录
记录非Gui模式Jmeter使用
Kotlin委托属性知识点
Flask 教程 第十章:邮件支持
图像噪声水平估计INLE_paper
使用fontforge修改字体,只保留数字
怎样在网上开户买股票比较安全?如何办理开户业务?
文档图像二值化DIB_database
Kotlin reflection
PHP使用glob()查找文件
学习笔记:栈的应用1_递归(重点)
学习笔记:第二部分 队列