TalendDate

Not a lot of examples around TalendDate so thought I'd post a couple of quick examples:

Today's date:
TalendDate.getDate("yyyy-MM-dd")
Returns:
2012-04-12

Yesterday's date:
TalendDate.addDate(TalendDate.getDate("yyyy-MM-dd"),"yyyy-MM-dd",-1,"dd")
Returns:
2012-04-11

Tomorrow's date:
TalendDate.addDate(TalendDate.getDate("yyyy-MM-dd"),"yyyy-MM-dd",1,"dd")
Returns:
2012-04-13

Date format:
CC - century
YY - year
MM - month
DD - day of month
hh - hour
mm - minutes
ss - seconds

Return types:
string!


Other methods:


TalendDate.compareDate(myDate,myDate2,"yyyy-MM-dd")
TalendDate.diffDate(myDate,myDate2,"MM")
TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",myDate)
TalendDate.setDate(mydate,newValue,"MM")
TalendDate.getFirstDayOfMonth(mydate)
TalendDate.getLastDayOfMonth(mydate)
TalendDate.getRandomDate("2007-01-01","2008-12-31")
TalendDate.parseDate("yyyy-MM-dd HH:mm:ss","")


Comments

Popular posts from this blog

Dealing with Nested Documents in MongoDB and Talend (aka Baking a Cake)

Add sbin to user PATH in Debian

Batch convert Asterisk GSM WAV files to mp3