Giter Club home page Giter Club logo

oracle-util-unixtime's Introduction

Oracle utility for display dates and timestamps in Unix time format (UTL_UNIXTIME)

Oracle utility package for getting unix timestamp in milliseconds from dates and timestamps.

Usages

a) Using current timestamp

SELECT utl_unixtime.current_time_millis FROM dual;
-- returns unix timestamp from database.

b) Using a date

SELECT utl_unixtime.date_to_millis(p_date_input => current_date) FROM dual;
-- returns current date as unix timestamp from database.

c) Using provided date as text and datetime format.

SELECT utl_unixtime.to_time_millis(p_date_text => '2003/07/09',p_date_format => 'yyyy/mm/dd') FROM dual;
-- returns 1057785728978.

For more examples of datetime formats: function to_date (from dba-oracle.com)

How to install

  1. Download the latest release -- https://github.com/marlonlom/oracle-util-millis/releases
  2. Extract the zip file
  3. Use sql*plus, or something capable of running sql*plus scripts, to run the install.sql script.
  4. To test the implementation, run the /tests/*.sql scripts.

NOTICE: Tested in Oracle 11g and 12c.

Project folders and files

  • install.sql install the utl_unixtime package in your schema.
  • src/ source code in PL/SQL, it is accessed by the install script.
  • tests/ useful examples to learn how to use utl_unixtime.

Contributing

Please follow the contributing guidelines to submit fixes or new features.

License

MIT License

oracle-util-unixtime's People

Contributors

marlonlom avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.