当前位置:网站首页>presto日期函数的使用
presto日期函数的使用
2022-04-23 06:15:00 【山顶看数据】
date_diff():求出两个时间的差值,里面的放的是两个时间戳,后面-前面=差值
eg:date_diff('day',from_iso8601_timestamp('2021-12-23'),from_unixtime(ctime/1000)) as gap
):以天为单位
from_iso8601_timestamp():将一个日期转换为时间戳
eg:from_iso8601_timestamp('2021-12-23') =>2021-12-23 00:00:00.000 Asia/Shanghai
from_unixtime():将日期进行格式化
eg:from_unixtime(ctime/1000)) => 2021-12-22 13:54:07.000
date_parse():将字符串的日期进行格式化
eg:date_parse(t2.logday,'%Y%m%a')
原来的logday是20211223,现在事解析成2021-12-23
select date_parse('20211222', '%Y%m%d'); =>2021-12-22 00:00:00.000
版权声明
本文为[山顶看数据]所创,转载请带上原文链接,感谢
https://blog.csdn.net/li1579026891/article/details/122198244
边栏推荐
猜你喜欢
Detailed explanation of unwind stack backtracking
SSL / TLS application example
重大安保事件应急通信系统解决方案
Are realrange and einsum really elegant
【点云系列】DeepMapping: Unsupervised Map Estimation From Multiple Point Clouds
GIS实战应用案例100篇(五十一)-ArcGIS中根据指定的范围计算nc文件逐时次空间平均值的方法
AUTOSAR从入门到精通100讲(八十六)-UDS服务基础篇之2F
Systrace 解析
PyTorch 10. Learning rate
Chapter 3 pytoch neural network toolbox
随机推荐
广西电网|应急空天一体化通信系统方案
Systrace 解析
PyTorch 19. PyTorch中相似操作的区别与联系
onnxruntime-gpu 1.7 出现的警告“Force fallback to CPU execution for node: Gather_191”等
Chapter 5 fundamentals of machine learning
torch.where能否传递梯度
PyTorch 9. optimizer
带低压报警的51单片机太阳能充电宝设计与制作(完整代码资料)
swin transformer 转 onnx
带您遨游太空,美摄科技为航天创意小程序提供全面技术支持
Draw margin curve in arcface
PyTorch 13. 嵌套函数和闭包(狗头)
【点云系列】DeepMapping: Unsupervised Map Estimation From Multiple Point Clouds
重大安保事件应急通信系统解决方案
unhandled system error, NCCL version 2.7.8
北峰通信助力湛江市消防支队构建PDT无线通信系统
Pytoch model saving and loading (example)
GIS实战应用案例100篇(五十二)-ArcGIS中用栅格裁剪栅格,如何保持行列数量一致并且对齐?
面试总结之特征工程
PyTorch 14. module类