Time Extension

thumbnail
(0)

Version 3.2.0  by WSO2

Category : Siddhi Function
Supported Product Version : CEP 4.2.0   DAS 3.1.0  

Summary

This extension provides time related functionality to Siddhi such as getting the current time, current date, manipulating/formatting dates, etc. Following are the functions of the time extension.


Associated Tags

Siddhi Time-Extension

Functions provided by time extension


  • Current Date function

    Returns the current system date in the yyyy-MM-dd format.
  • Current Time function

    Returns the current system time in the HH:mm:ss format.
  • Current Timestamp function

    Returns the current system timestamp in the yyyy-MM-dd HH:mm:ss format.
  • Date Adding function

    The common parameters of this function are described below.
    • dateValue : A value of date. e.g.,"2014-11-11 13:23:44.657", "2014-11-11", "13:23:44.657"
    • expr : The amount by which the selected part of the date format should be incremented. e.g., 2,5,10 etc.
    • unit : The part of the date format that needs to be manipulated. e.g., "MINUTE", "HOUR", "MONTH", "YEAR", "QUARTER", "WEEK", "DAY", "SECOND"
    • dateFormat : The date format of the date value provided. e.g., yyyy-MM-dd HH:mm:ss.SSS
    • timestampInMilliseconds : The date value in milliseconds (from the epoch). e.g., 1415712224000L
  • Date Subtracting function

    The common parameters of this function are described below.
    • dateValue1 : A value of date. e.g., "2014-11-11 13:23:44.657", "2014-11-11", "13:23:44.657"
    • dateValue2 : A value of date. e.g., "2014-11-11 13:23:44.657", "2014-11-11" , "13:23:44.657"
    • dateFormat1 : The date format of dateValue1 . e.g., yyyy-MM-dd HH:mm:ss.SSS
    • dateFormat2 : The date format of dateValue2 . e.g., yyyy-MM-dd HH:mm:ss.SSS
    • timestampInMilliseconds1 : A date value in milliseconds (from the epoch) e.g., 1415712224000L
    • timestampInMilliseconds2 :A date value in milliseconds (from the epoch) e.g., 1415712224000L
  • Date Difference function

    The common parameters of this function are described below.
    • dateValue : A value of date. e.g.,"2014-11-11 13:23:44.657", "2014-11-11", "13:23:44.657"
    • expr : The amount by which the selected part of the date format should be incremented. e.g., 2,5,10 etc.
    • unit : The part of the date format that needs to be manipulated. e.g., "MINUTE", "HOUR", "MONTH", "YEAR", "QUARTER", "WEEK", "DAY", "SECOND"
    • dateFormat : The date format of the date value provided. e.g., yyyy-MM-dd HH:mm:ss.SSS
    • timestampInMilliseconds : The date value in milliseconds (from the epoch). e.g., 1415712224000L
  • Date Format function

    The common parameters of this function are described below.
    • dateValue : A value of date. e.g., "2014-11-11 13:23:44.657", "2014-11-11" , "13:23:44.657"
    • dateTargetFormat : The date format to which the specified date value needs to be converted. e.g., yyyy/MM/dd HH:mm:ss
    • dateSourceFormat : The date format of the date value provided. e.g., yyyy-MM-dd HH:mm:ss.SSS
    • timestampInMilliseconds : A date value in milliseconds (from the epoch) e.g., 1415712224000L
  • Extract function

    The common parameters of this function are described below.
    • dateValue : A value of date. e.g., "2014-11-11 13:23:44.657", "2014-11-11" , "13:23:44.657"
    • unit : The part of the date format that needs to be manipulated. e.g., "MINUTE", "HOUR", "MONTH", "YEAR", "QUARTER", "WEEK", "DAY", "SECOND"
    • dateFormat : The date format of the date value provided. e.g., yyyy-MM-dd HH:mm:ss.SSS
    • timestampInMilliseconds : A date value in milliseconds (from the epoch) e.g., 1415712224000L
  • Date function

    Returns the date component of the dateValue.
  • Timestamp In Milliseconds function

    Returns the current or specified time stamp in milliseconds.
  • UTC Timestamp function

    Returns the system time in the yyyy-MM-dd HH:mm:ss date format.

Social Sites