The Current DateTime function returns the current datetime from the JVM (Java™ Virtual Machine) that MashupHub is using.
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.
This function does not require you to specify any parameters.
The function returns a String that is the current datetime, in Atom datetime format, from the JVM (Java Virtual Machine) that MashupHub is using.
The function returns the datetime in the timezone of the JVM (Java Virtual Machine) for MashupHub. For example, if the JVM for MashupHub uses the Eastern Standard Time (EST) in the United States, the function could return the following datetime, Thu, 1 May 2008 01:10:55 EST
. However, if the JVM for MashupHub uses the Pacific Standard Time (PST), the function would return Wed, 30 April 2008 23:10:55 PST
for the same datetime.
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 PST timezone.
|Type of feed||Example datetime format|
|RSS||Thu, 09 Nov 2006 14:48:40 -0800|
Day of the week is optional for the RSS feed format.
This example shows you how to use the Current DateTime and Format DateTime functions to filter feeds to display elements for the current date. You use the Transform and Filter operators to accomplish this task. The following example uses a Source feed that contains news information and a publication date. The Source feed has the following structure when you Preview it:
In the Transform operator, create an output element atom_datetime
to format the pubDate
element to the Atom format. The following table lists the values for the output element:
|Input tree value||Function/Value||Output element|
|./pubDate||Format DateTime /Atom||atom_datetime|
In a Filter operator, filter the feed to display only today's entries. For example, to create a filter to display all feed elements whose date is today's date, set the following comparison and select All
for the conditions that must be satisfied. The following table lists the filter values:
For the regular expression used in the filter, use the following values:
The regular expression (^ [^T]*)
returns the datetime string up to the letter T, date portion of the datetime. For example, if the datetime is 2008-05-07T12:20:03.000-07:00
the regular expression returns 2008-05-07
Parent topic: Builtin functions: imc3
Supported date formats: imc3