Contents: MashupHub User and Administrator Guide : Mashup Center 2.0
Use the Month from DateTime function to return an Integer between 1 and 12, inclusive, that represents the month component of a datetime string.
For example, if you specify an RSS datetime string of Wed, 30 Apr 2008 13:10:55 EDT
, this function returns 4
A datetime might include either the code for the timezone, or the hours offset from GMT (Greenwich Mean Time). For example, the datetime Wed, 30 Apr 2008 13:10:55 PST
indicates the Pacific Standard Time (PST) timezone in the United States. This datetime might also appear as Wed, 30 Apr 2008 13:10:55 -0800
, since PST is -8 hours from GMT.
The datetime value that you want to return the month from.
For the Date Value
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 Date Value
must be a string in the RSS or Atom datetime format.
The following table shows an example of the Atom and RSS feed datetime formats for Thursday, November 9, 2006, 2:48:40 PM in the Pacific Standard Time (PST) timezone.
Type of feed
Example datetime format
Thu, 09 Nov 2006 14:48:40 -0800
Day of the week is optional for the RSS feed format.
The function returns an Integer value between 1 and 12, both inclusive, that represents the month component of a datetime value. For the datetime Wed, 30 Apr 2008 13:10:55 EDT
, this function returns 4
The function returns the month component of the datetime Date Value
converted to the time zone of the local JVM (Java Virtual Machine), the JVM that MashupHub is using.
If the JVM for MashupHub uses one time zone and the value that you specify uses another timezone, the value that is returned is in the time zone of the local JVM. For example, the JVM that MashupHub is using is set to the -8:00 timezone, the Pacific Standard Time (PST) timezone. If you specify the RSS datetime string Thu, 1 May 2008 01:10:55 EST
a datetime in the Eastern Standard Time (EST) timezone in the United States, the function returns 4
, the month value for the datetime in the PST timezone. The date time Thu, 01 May 2008 01:10:55 EST
in the PST timezone is Wed, 30 Apr 2008 22:10:55 -0800
You can use datetime functions to filter feeds based on date using a Transform operator to create three output elements that contain day, month, and year for each feed entry and a Filter operator to filter the feed based on the output elements. The following example uses a source feed that contains news information and a publication date. The source feed has the following structure:
In the Transform operator, create output elements for the day, month, and year similar to the following:
Input tree value
Day from DateTime
Month from DateTime
Year from DateTime
In a Filter operator, filter the feed to display entries that have been published after a specific date. For example, to create a filter to display all feed elements starting from May 1, 2008, set the following comparisons and select All
for the conditions that must be satisfied. The following table lists the filter values:
You can use variables to specify any date and not just a fixed date. When the feed is viewed from the catalog or run outside of MashupHub, the user is prompted for the day, month and year values.
Parent topic: Functions : Mashup Center 2.0
Functions : Mashup Center 2.0
Supported date formats : Mashup Center 2.0