Planet Jaspersoft

April 12, 2012

TalendDate

Ernesto Ongaro
Tech Poet )

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","")


April 12, 2012

About

Planet Jaspersoft aggregates blog posts from our community. If you would like your blog to be included in the Planet, please follow this help guide. Or just click this link to go straight to your Planet Feeds.

Feedback