Skip to main content link. Accesskey S
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • IBM Mashup Center wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search
IBM Translated Product Documentation...

 Planning, Installing, Configuring Mashup Center 3.0.0.1

 Planning, Installing, Configuring Mashup Center 3
 Enterprise Content Management Widgets 4.5.2.1 documentation

 IBM Mashup Center 2.0.0.2 documentation

Tag Cloud

  • 2.0
  • 3.0
  • 3.0.0.1
  • action widgets
  • actions
  • admin
  • administering
  • administration
  • administrator
  • adminstering
  • AJAX
  • AJAX proxy
  • annotate function
  • annotator
  • API
  • api reference
  • benchmark testing
  • catalog
  • configuing
  • configuration
  • configure
  • configuring
  • creating
  • creating mashups
  • data
  • data mashup builder
  • data mashups
  • database
  • DB2
  • demo
  • deploy
  • deployment
  • designing applications
  • developer
  • developing
  • developing mashups
  • developing widgets
  • documentation
  • ECM Widgets
  • editing
  • Enterprise Content Management Widgets
  • errors
  • events
  • examples
  • explanations
  • feed
  • feed mashups
  • feeds
  • format
  • functions
  • getting started
  • greenhouse
  • guide
  • IMS database feeds
  • IMS feeds
  • IMS transaction feeds
  • installation
  • installing
  • mashup
  • MashupHub
  • mashuphub examples
  • mashuphub users guide
  • mashups
  • messages
  • migrating
  • objects
  • operators
  • Oracle
  • pages
  • payload types
  • pdf
  • performance
  • performance tuning
  • planning
  • product
  • programming
  • proxy
  • rest services
  • security
  • service
  • spaces
  • themes
  • troubleshooting
  • tutorial
  • tutorials
  • upgrading
  • user
  • users
  • v1.0
  • v1.1
  • v2.0
  • v2.0.0.2
  • v4.5.2.1
  • video
  • WAR
  • widget
  • widgets
  • widgets
  • wire
  • YouTube
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > IBM Mashup Center 2.0.0.2 documentation > Add DateTime Duration function
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
(Current editable edition)
Original noneditable edition
Current editable edition
(Original noneditable edition)

Add DateTime Duration function 

expanded Abstract
collapsed Abstract
The Add DateTime Duration function adds a datetime interval to a datetime value.
Table of Contents: User and Administrator Guide : Mashup Center 2.0.0.2


The Add DateTime Duration function adds a datetime interval to a datetime value.

For example, use the Add DateTime Duration function to find all entries published during the first week of the year.

Parameters

Input
    The datetime value to which you want to add the duration.


    For the Input parameter you can:
    • Specify a text value.
    • Specify a function value.
    • Use a variable to return the value.
    • Specify a value from the Input tree.

    The Input value must be a datetime value or a string that can be cast to a datetime using one of the default formats. If it is not already a datetime or is not in a default format, first convert it using the Create DateTime function.

Year
    The number of years as an integer >= 0. This value to initialized to 0.

Month
    The number of months as an integer >= 0. This value to initialized to 0.

Day
    The number of days as an integer >= 0. This value to initialized to 0.

Hours
    The number of hours as an integer >= 0. This value to initialized to 0.

Minutes
    The number of minutes as an integer >= 0. This value to initialized to 0.

Seconds
    The number of seconds as an integer or decimal >= 0. This value to initialized to 0.0.

Each value must be >= 0. Negative values are ignored.

Returned value

A new datetime value.

Example

This example shows how to use the Filter operator and the Add DateTime Duration function to find all entries that were published during the first week of January 2009.

Assume a feed has a pubDate element in RSS format:

<pubDate>Fri, 02 Jan 2009 21:45:17 +0000</pubDate>


Follow these steps to find all entries that were published during the first week of January 2009:
  1. Add the Filter operator to the canvas. You will add two filter conditions.
  2. The first filter condition searches for all entries >= January 1, 2009:
    • For the Input element, specify the pubDate element in the Input tree.
    • Right-click the pubDate value and choose "Date" to cast the value to a Date.
    • Select >= for the Comparison.
    • For the Value, enter "2009-01-01".
      • Tip: Because you explicitly cast the Input element to Date, MashupHub will attempt to cast the Value to a date also. This action succeeds if you enter the date value in one of the default formats, such as RSS or Atom. This example entered the date in Atom format.
    • Click the plus sign (+) to add the second filter condition. The second filter condition searches for all entries <= January 1, 2009 + 1 week.
    • For the Input element, again specify the pubDate element in the Input tree. It should already be marked as a Date.
    • Select <= for the Comparison .
    • For the Value, select the Add DateTime Duration function.
    • For the Input parameter, enter "2009-01-01".
      • Because the date is in Atom format, which is one of the supported default formats, you do not need to cast it.
    • Enter 7 in the Day field. Leave the rest of the fields set to 0.
      • The parameters in the Add DateTime Duration function dialogue will be the following.

        Table 1. Add DateTime function parameters
        NameValue
        Input "2009-01-01"
        Year0
        Month 0
        Day 7
        Hours0
        Minutes 0
        Seconds 0.0

  3. Click OK. The filter conditions will be the following.

    • Table 2. Filter conditions
      Input element Comparison Value
      ./pubDate/text()[1]
       
      =
      "2009-01-01"
      ./pubDate/text()[1] <= duration-add()

When the filter condition runs, all datetime values in the feed are converted to the time zone of the JVM on which MashupHub is installed. The datetime value at the start of this example, Fri, 02 Jan 2009 21:45:17 +0000, was generated in the Coordinated Universal Time (UTC) time zone. That datetime value is converted to the local time zone, then the comparison to January 1 2009 + 7 days is performed.

Parent topic: Functions : Mashup Center 2.0.0.2

Related concepts
Functions : Mashup Center 2.0.0.2

Related reference
Supported date formats : Mashup Center 2.0.0.2

expanded Article information
collapsed Article information
Category:
IBM Mashup Center 2.0.0.2 documentation, Product Documentation,
Tags:
data mashups, Add DateTime Duration function, operators, functions, v2.0.0.2, v2.0, MashupHub, user, administrator, admin

This Version: Version 1 April 28, 2010 9:49:14 AM by IBM  IBMer

expanded Attachments (0)
collapsed Attachments (0)

 


expanded Versions (1)
collapsed Versions (1)
Version Comparison     
Version Date Changed by               Summary of changes
This version (1) Apr 28, 2010 9:49:14 AM IBM  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedSubscribe to RSSHelpAbout
  • All Lotus and WebSphere Portal wikis
  • IBM developerWorks
  • IBM Software support
  • IBM Social Business User Experience Blog
  • IBMSocialBizUX on Twitter
  • IBMSocialBizUX on Facebook
  • Lotus product forums
  • IBM Social Business UX blog
  • IBM Collaboration Solutions
  • Recently added feedRecently added
  • Recently edited feedRecently edited
  • Recently added comments feedRecently Added Comments
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Contact IBM
  • IBM Terms of use
  • Wiki terms of use