ORACLE: Convert milliseconds to date, get information for one day

Source: Internet
Author: User
Tags postgresql



Oracle milliseconds to date








SELECT TO_CHAR(1406538765000 / (1000 * 60 * 60 * 24) +      
        TO_DATE(‘1970-01-01 08:00:00‘, ‘YYYY-MM-DD HH:MI:SS‘), ‘YYYY-MM-DD HH24:MI:SS‘) AS CDATE      
 FROM DUAL;


Date conversion milliseconds






SELECT TO_NUMBER(TO_DATE(‘2014-07-28 17:12:45‘, ‘YYYY-MM-DD HH24:MI:SS‘) -      
                TO_DATE(‘1970-01-01 8:0:0‘, ‘YYYY-MM-DD HH24:MI:SS‘)) * 24 * 60 * 60 * 1000      
 FROM DUAL;


Get the information for a day






select * from WORKSCANINFO where TO_CHAR(SCANDATE,‘DD-MM-YY‘) 
in(
  SELECT TO_CHAR(1511539200000 / (1000 * 60 * 60 * 24) +      
        TO_DATE(‘01-01-70‘, ‘DD-MM-YY‘), ‘DD-MM-YY‘) AS CDATE      
  FROM DUAL)




ORACLE: Convert milliseconds to date, get information for one day




Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.