当前位置:网站首页>Use of Presto date function
Use of Presto date function
2022-04-23 12:57:00 【Look at the data at the top of the mountain】
date_diff(): Find the difference between the two times , Inside are two time stamps , Back - front = Difference value
eg:date_diff('day',from_iso8601_timestamp('2021-12-23'),from_unixtime(ctime/1000)) as gap
): In days
from_iso8601_timestamp(): Convert a date to a timestamp
eg:from_iso8601_timestamp('2021-12-23') =>2021-12-23 00:00:00.000 Asia/Shanghai
from_unixtime(): Format the date
eg:from_unixtime(ctime/1000)) => 2021-12-22 13:54:07.000
date_parse(): Format the date of the string
eg:date_parse(t2.logday,'%Y%m%a')
The original logday yes 20211223, Now it turns into 2021-12-23
select date_parse('20211222', '%Y%m%d'); =>2021-12-22 00:00:00.000
版权声明
本文为[Look at the data at the top of the mountain]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230615025044.html
边栏推荐
- MySQL supports IP access
- Realize several "Postures" in which a box is horizontally and vertically centered in the parent box
- 软件测试周刊(第68期):解决棘手问题的最上乘方法是:静观其变,顺水推舟。
- 风尚云网学习-input属性总结
- 云原生KubeSphere部署Redis
- 22. 括号生成
- 云原生KubeSphere部署Mysql
- Golang implements a five insurance and one gold calculator with web interface
- Aviation core technology sharing | overview of safety characteristics of acm32 MCU
- The continuous construction of the Internet industry platform is not only able to collect traffic
猜你喜欢
Customize the shortcut options in El date picker, and dynamically set the disabled date
STM32 project transplantation: transplantation between chip projects of different models: Ze to C8
Fashion cloud learning - input attribute summary
Deploying MySQL in cloud native kubesphere
SSM框架系列——Junit单元测试优化day2-3
5 free audio material websites, recommended collection
CVPR 2022&NTIRE 2022|首个用于高光谱图像重建的 Transformer
Aviation core technology sharing | overview of safety characteristics of acm32 MCU
31. Next arrangement
Synchronously update the newly added and edited data to the list
随机推荐
Baserecyclerviewadapterhelper realizes pull-down refresh and pull-up loading
洛谷P3236 [HNOI2014]画框 题解
Object. The disorder of key value array after keys
Try the server for one month for free, and attach the tutorial
进程虚拟地址空间区域划分
Introduction to servlet listener & filter
Go language mapping operation
There is no need to crack the markdown editing tool typora
box-sizing
mysql中 innoDB执行过程分析
SSL certificate refund instructions
4.DRF 权限&访问频率&过滤&排序
Kubernetes 入門教程
大家帮我看一下这是啥情况,MySQL5.5的。谢了
21 天学习MongoDB笔记
The continuous construction of the Internet industry platform is not only able to collect traffic
Analysis of InnoDB execution process in MySQL
数据库中的日期时间类型
云原生KubeSphere部署Mysql
Resolve disagrees about version of symbol device_ create