• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Issue with date type in a tMap

#1 2009-06-24 15:36:42

pierre-henri
Guest

Issue with date type in a tMap

Tags: [date, postgres, tmap]

Hello again,

I've got another problem with dates. Into my tMap I managed to parse a date from a string, the tMap input is like this (String type):

"YYYY-MM-DDTHH:MM:SS.SSSZ"

I parse the date with this operation :

(row2.dateheure.equals(""))? null : TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",row2.dateheure)       

And here is what I've got as output (Date type):

Sun Jun 21 15:57:01 CEST 2009

And in my postgresql database (timestamp with time zone type) :

"2009-06-21 00:00:00+02"

Well that's half good I retrieve the date partially, how can I do to also get hours, minutes, seconds ?

#2 2009-06-24 16:04:36

Morbo
Member
Company: Inserm
Registered: 2009-05-14
Posts: 228

Re: Issue with date type in a tMap

U can define the exact pattern in the schema of your inputDatabase connector.

Offline

#3 2009-06-24 16:36:41

pierre-henri
Guest

Re: Issue with date type in a tMap

I've got a file delimiter as input. I retrieve the date as String type, I can't link any pattern to a string. It's only in the tMap tool that I transform this string into a date type with talend.parseDate function.

And I've also set the tMap output and tPostgreSQLOutput with the correct pattern, I still got the hours, minutes, seconds missing into the database.

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Issue with date type in a tMap

Board footer

Powered by FluxBB