当前位置:网站首页>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
边栏推荐
猜你喜欢
Wechat applet uses wxml2canvas plug-in to generate some problem records of pictures
SHA512/384 原理及C语言实现(附源码)
Int8 quantification and inference of onnx model using TRT
重大安保事件应急通信系统解决方案
GIS实用小技巧(三)-CASS怎么添加图例?
excel实战应用案例100讲(八)-Excel的报表连接功能
WinForm scroll bar beautification
AUTOSAR从入门到精通100讲(五十一)-AUTOSAR网络管理
Gephi tutorial [1] installation
CMSIS CM3源码注解
随机推荐
公专融合对讲机是如何实现多模式通信下的协同工作?
[8] Assertion failed: dims. nbDims == 4 || dims. nbDims == 5
Proteus 8.10安装问题(亲测稳定不闪退!)
Detailed explanation of device tree
SHA512/384 原理及C语言实现(附源码)
Unable to determine the device handle for GPU 0000:02:00.0: GPU is lost.
如何利用qemu搭建SOC protoype:80行代码实现一个Cortex M4 模拟器
各类日期转化的utils
enforce fail at inline_container.cc:222
onnxruntime-gpu 1.7 出现的警告“Force fallback to CPU execution for node: Gather_191”等
被 onnx.checker.check_model 检查出的常见错误
GIS实战应用案例100篇(三十四)-拼接2020globeland30
Common regular expressions
机器视觉系列(02)---TensorFlow2.3 + win10 + GPU安装
Pep517 error during pycuda installation
PyTorch 22. PyTorch常用代码段合集
PyTorch 9. optimizer
海南凤凰机场智能通信解决方案
AUTOSAR从入门到精通100讲(八十六)-UDS服务基础篇之2F
EMMC/SD学习小记