Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone
I have a tMap with:
"01/"+row1.month
as VAR1 in the middle, and then is passed to the output
TalendDate.parseDate("dd/MM", Var.VAR1 )
I have days and months but I need THE CURRENT YEAR. ¿ What would be the best option?
Thank you.
Hi,
TalendDate.parseDate("dd/MM/YYYY",Var.VAR1 +"/"+ TalendDate.formatDate("YYYY",TalendDate.getCurrentDate()
))
Send me Love and Kudos
Hi!
I tried this code and Idk why Im having another month:
Column month are the months of my table, column Date is your code
Hi,
I saw month is only on one character :
so in var1 you can replace row1.month by : String.format("%02d",Integer.valueOf(row1.month))
it will add a zero on the left if month is only on one character.
Send Me love and Kudos
Hi again!
I fixed the day and month variable as "01/"+ String.format("%02d",Integer.valueOf(row1.month))
And in the output I put your code as in the first response.
BUT I still have the same problem, the mont is other, so strange...
The first column is only the day and month (with the zero)
The second column is your code.
Could you send the date pattern of the date output schema ?
I think you have to set the date pattern in your output schema as :
"dd/MM/YYYY"
This is the pattern in the output:
I created a var2 with only the year
And then in the output I have var1 + var2
But in the DDBB I still have the data with another month and the format isn't the correct despite being put the format with "/" and year at final
Hi, if ou put a tlogrow after the tmap , wich value do you have?
You try to send it in a database ,if yes in wich database (sql server ,postgre, mysql...)?
the pattern seems to be :
"YYYY-MM-DD hh:mm:ss.SSS"
so maybe try :
Var.VAR1 = String.format("%02d",Integer.valueOf(row1.month)) +"-01"
output : Var.VAR2 + "-"+Var.VAR1
pattern of output : "YYYY-MM-DD"
and maybe on your database server don't have the same utc date, it can cause different date if you have some hour of shift.
Yes, im trying to send this to a DDBB, SQL SERVER. I put the pattern as "dd/MM/YYYY" but still in YYYY-MM-DD