Contents: MashupHub User and Administrator Guide : Mashup Center 2.0
The Day from DateTime function returns the day component of a datetime string.
For example, if you specify an RSS datetime string of Wed, 30 Apr 2008 13:10:55 PST
, this function returns 30
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) time zone 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 day from.
For the 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.
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) time zone.
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.
This function returns an Integer between 1 and 31, both inclusive, that represents the day component of Value
. For the datetime Wed, 30 Apr 2008 13:10:55 EDT
, this function returns 30
If the JVM (Java Virtual Machine) 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 Thu, 1 May 2008 01:10:55 EST
datetime specifies the Eastern Standard Time (EST) timezone in the Unites States. This same datetime in the Pacific Standard Time (PST) time zone in the United States is Wed, 30 April 2008 23:10:55 PST
. If the local JVM is in the PST time zone, the Day from DateTime function returns 30
, the day value for the datetime in the PST time zone.
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