HBase时间戳格式化为标准日期

1.在 hbase shell中

import java.util.Date
import java.text.SimpleDateFormat
SimpleDateFormat.new("yyyy-MM-dd HH:mm:ss").format(Date.new(1442470943386))

2.在 java中

import java.util.Date;
import java.text.SimpleDateFormat;
System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Long.parseLong("1442470943386")));;
时间: 2024-08-04 00:18:19

HBase时间戳格式化为标准日期的相关文章

[JavaScript] 时间戳格式化为yyyy-MM-dd日期

function formateDate(timestamp){ var date = new Date(timestamp); var y = 1900+date.getYear(); var m = "0"+(date.getMonth()+1); var d = "0"+date.getDate(); return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substrin

js 将long日期格式转换为标准日期格式

//扩展Date的format方法 Date.prototype.format = function (format) { var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+&qu

js时间戳怎么转成日期格式

原文地址:http://www.sufeinet.com/thread-1500-1-1.html js时间戳怎么转成日期格式这个在主群里有朋友§☆釺哖蟲...o问js时间戳怎么转成日期格式 ,他的问题是这样的/Date(1354116249000)/ 这样的格式怎么转成时间格式这是从C#的Datatime格式通过Json传到Js里面的,下面是我们的提供的方法js需要把时间戳转为为普通格式,一般的情况下可能用不到的,下面先来看第一种吧 <script> function getLocalTim

orcale将日期格式化为“yyyy年mm月dd日”的形式

orcale将日期格式化为"yyyy年mm月dd日"的形式,懂的人不难,不懂的人就怎么也整不出来. 如下: select to_char(sysdate,'yyyy"年"mm"月"dd"日"') from dual

PHP获取当前时间、时间戳的各种格式写法汇总[日期时间]

原文:PHP获取当前时间.时间戳的各种格式写法汇总[日期时间] 今天写下php中,如何通过各种方法 获取当前系统时间.时间戳,并备注各种格式的含义,可灵活变通. 1.获取当前时间方法date() 很简单,这就是获取时间的方法,格式为:date($format, $timestamp),format为格式.timestamp为时间戳--可填参数. 2.获取时间戳方法time().strtotime() 这两个方法,都可以获取php中unix时间戳,time()为直接获取得到,strtotime($

实例365(8)---------三种方法将字符串格式化为日期

一:DateTime.ParseExact方式,截图 二:代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ConvertToString { public

mysql 时间转换 用EXCEL实现MySQL时间戳格式和日期格互转

今天项目表中需要导入好几w条数据 ,但日期由两个一个是标准时间一个为时间戳,程序中搜索是根据时间戳来搜索的,所以在网上翻箱倒柜的终于找到解决之道了,利用excel转换时间戳 时间戳转成正常日期的公式:B1=(A1+8*3600)/86400+70*365+19其中A1表示当时的1249488000数值其中B1就是你需要的结果,B1单元格属性改成日期格式就可以了.正常日期转为时间戳格式公式:A1=(C1-70*365-19)*86400-8*3600其中C1表示当时的1249488000数值其中A

时间戳怎么转成日期格式

原文地址:http://www.sufeinet.com/thread-1500-1-1.html js时间戳怎么转成日期格式这个在主群里有朋友§☆釺哖蟲...o问js时间戳怎么转成日期格式 ,他的问题是这样的/Date(1354116249000)/ 这样的格式怎么转成时间格式这是从C#的Datatime格式通过Json传到Js里面的,下面是我们的提供的方法js需要把时间戳转为为普通格式,一般的情况下可能用不到的,下面先来看第一种吧 <script> function getLocalTim

SpringBoot返回date日期格式化,解决返回为TIMESTAMP时间戳格式或8小时时间差

问题描述 在Spring Boot项目中,使用@RestController注解,返回的java对象中若含有date类型的属性,则默认输出为TIMESTAMP时间戳格式 ,如下所示: 解决方案       解决方案有多种,这里只记录本人觉得最简单的一种.一般我们的日期显示格式为:yyyy-MM-dd HH:mm:ss,所以我们可以在配置文件中进行全局配置. 在application.properties配置文件增加以下配置:: spring.jackson.date-format=yyyy-MM