当前位置:网站首页>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
边栏推荐
猜你喜欢

WinForm scroll bar beautification

【点云系列】DeepMapping: Unsupervised Map Estimation From Multiple Point Clouds

Gather, unsqueeze and other operators when PTH is converted to onnx

使用 trt 的int8 量化和推断 onnx 模型

画 ArcFace 中的 margin 曲线

【51单片机交通灯仿真】

基于openmv的无人机Apriltag动态追踪降落完整项目资料(labview+openmv+apriltag+正点原子四轴)

基于Labview上位机的51单片机步进电机控制系统(上位机代码+下位机源码+ad原理图+51完整开发环境)

Face_ Recognition face detection

机器视觉系列(01)---综述
随机推荐
关于短视频平台框架搭建与技术选型探讨
防汛救灾应急通信系统
各类日期转化的utils
RISCV MMU 概述
By onnx checker. check_ Common errors detected by model
机器视觉系列(01)---综述
onnxruntime-gpu 1.7 出现的警告“Force fallback to CPU execution for node: Gather_191”等
基于51单片机的温湿度监测+定时报警系统(c51源码)
Intuitive understanding of torch nn. Unfold
基于Labview上位机的51单片机步进电机控制系统(上位机代码+下位机源码+ad原理图+51完整开发环境)
Systrace parsing
PyTorch 13. 嵌套函数和闭包(狗头)
go语言:在函数间传递切片
AUTOSAR从入门到精通100讲(五十二)-诊断和通信管理功能单元
画 ArcFace 中的 margin 曲线
Cmder Chinese garbled code problem
商业版阿里MQ普通消息发送订阅Demo
多机多卡训练时的错误
Use originpro express for free
SPI NAND FLASH小结