Professional Documents
Culture Documents
7)
You can use the date and time functions to perform various operations on dates and times in
the Transformer stage.
Functions that specify dates, times, or time stamps in the arguments use strings with
specific formats:
Functions that have the days of week in the argument take a string that specifies the day of
the week. The day is specified as a three-letter abbreviation, or the full name. For example,
the strings "thu" and "thursday" are both valid.
The following functions are in the Date & Time category of the expression editor. Square
brackets indicate that an argument is optional. The examples show the function as it appears
in a Derivation field in the Transformer stage.
CurrentDate
Returns the date that the job runs.
CurrentDate()
CurrentTime
Returns the time at which the job runs.
CurrentTime()
CurrentTimeMS
Returns the time, including microseconds, at which the job runs.
CurrentTimeMS()
CurrentTimestamp
Returns a time stamp that gives the date and time that the job runs.
CurrentTimestamp()
CurrentTimestampMS
Returns a time stamp, including microseconds, that gives the date and time that the
job runs.
CurrentTimestampMS()
DateFromDaysSince
Returns a date string by adding an integer to a baseline date. The integer can be
negative to return a date that is earlier than the baseline date. This function is
deprecated in IBM® InfoSphere® Information Server, Version 11.3. Use
the DateFromDaysSince2 function.
DateFromDaysSince(-1,"1958-08-18")
DateFromDaysSince(mylink.mynegintcol,"1958-08-18")
DateFromDaysSince(mylink.mynegintcol,mylink.mydatecol)
DateFromDaysSince2
Returns a date object by adding an integer to a baseline date. The integer can be
negative to return a date that is earlier than the baseline date.
DateFromDaysSince2(-1,"1958-08-18")
DateFromDaysSince2(mylink.mynegintcol,"1958-08-18")
DateFromDaysSince2(mylink.mynegintcol,mylink.mydatecol)
DateFromComponents
Returns a date from the given years, months, and day of month that is given as three
separate values.
DateFromJulianDay
Returns a date from the given Julian day number.
DateOffsetByComponents
Returns the given date, with offsets applied from the given year offset, month offset,
and day of month offset, given as three separate values. The offset values can each
be positive, zero, or negative.
DaysSinceFromDate
Returns the number of days from the source date to the given date. This function is
deprecated in IBM InfoSphere Information Server, Version 11.3. Use
the DaysSinceFromDate2 function.
DaysSinceFromDate2
Returns the number of days from the source date to the given date.
DaysInYear
Returns the number of days in the year in the given base date.
DaysInYear(mylink.mysourcedate)
DaysInYear("2011-08-18")
DateOffsetByDays
Returns the given date offset by the given number of days. The offset value can be
positive, zero, or negative.
HoursFromTime
Returns the hours portion of a time.
Input: time (time)
Output: hours (int8)
Examples. If mylink.mytime contains the time 22:30:00, then the following
two functions are equivalent, and return the integer value 22.
HoursFromTime(mylink.mytime)
HoursFromTime("22:30:00")
JulianDayFromDate
Returns a Julian day number from the given date.
MicroSecondsFromTime
Returns the microsecond portion of a time.
MidnightSecondsFromTime
Returns the number of seconds from midnight to the given time.
MinutesFromTime
Returns the minutes portion of a time.
MonthFromDate
Returns the month number from the given date.
NextWeekdayFromDate
Returns the date of the specified day of the week soonest after the source date. The
day of the week is specified as the full name, for example, thursday, or a three-letter
abbreviation, for example, thu.
PreviousWeekdayFromDate
Returns the date of the specified day of the week that is the most recent day before
the source date. The day of the week is specified as the full name, for example,
thursday, or a three-letter abbreviation, for example, thu.
SecondsSinceFromTimestamp2
Returns the number of seconds between two time stamp objects.
TimeDate
Returns the system time and date as a formatted string.
TimeFromComponents
Returns a time from the given hours, minutes, seconds, and microseconds, given as
four separate values.
TimeFromMidnightSeconds
Returns the time given the number of seconds since midnight.
TimeOffsetByComponents
Returns the time, with offsets applied from the base time with hour offset, minute
offset, and second offset, each given as separate values. The seconds offset can
include partial seconds.
TimeOffsetBySeconds
Returns the given time, with offsets applied from the base time with seconds offset.
The seconds offset can include partial seconds.
TimestampFromDateTime
Returns a time stamp from the given date and time.
TimestampFromSecondsSince
Returns a time stamp that is derived from the number of seconds from the base time
stamp string. This function is deprecated in IBM InfoSphere Information Server,
Version 11.3. Use the TimestampFromSecondsSince2 function.
TimestampFromSecondsSince2
Returns a time stamp that is derived from the number of seconds from the base time
stamp object.
TimestampFromTimet
Returns a time stamp from the given UNIX time_t string value.
TimestampFromTime2
Returns a time stamp from the given time and timestamp objects. The value in the
time object overwrites the time value in the time stamp object so that only the date
part is used from the time stamp.
TimestampOffsetByComponents
Returns the time stamp, with offsets applied from the base time stamp with year
offset, month offset, day offset, hour offset, minute offset, and second offset, each
given as separate values. The seconds offset can include microseconds.
TimestampOffsetBySeconds
Returns the time stamp, with offsets applied from the base time stamp with seconds
offset. The seconds offset can include microseconds.
TimetFromTimestamp
Returns a UNIX time_t value from the given time stamp.
WeekdayFromDate
Returns the day number of the week from the given date. Origin_day optionally
specifies the day that is regarded as the first in the week and is Sunday by default.
WeekdayFromDate("2008-08-18","saturday")
WeekdayFromDate(mylink.mydate,mylink.origin_day)
YeardayFromDate
Returns the day number in the year from the given date.
YearweekFromDate
Returns the week number in the year from the given date.