Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
i have a probleme to convert a date :
2011-08-19 15:00:10.
in this format :
2011-08-19
how to delete time from date 2011-08-19 15:00:10.
best regards
depend from what You have and what want to have:
- is it string or date?
- is target must be string or date?
all around - formateDate/parseDate/substring
all 3 function You can find in tMap build expression
hi @vapukov
thank you for your answer ,
type of input is format date 'dd-MM-yyyy HH:mm:ss' i want to have in out date but without time 'dd-MM-yyyy
any help for this problme
best regards
@hechmi wrote:
hi @vapukov
thank you for your answer ,
type of input is format date 'dd-MM-yyyy HH:mm:ss' i want to have in out date but without time 'dd-MM-yyyy
any help for this problme
best regards
Hi, what I gave you was an example. You can ask for any format you want, keeping in mind how to represent it. Here is a link that might help. You can also google for java date format conversion.
@hechmi do you know the type of data you are working with? Is it a String (text) or is it a Date (essentially a number representation of a date)? If you are not sure, can you take a screenshot of the schema you are using and post it. Without this information, it is not possible to tell you how to solve this.
i have date_transaction time in source data 'dd-MM-yyyy hh:mm:ss' 'input' i want will have date_transaction out put without time 'dd-MM-yyyy'
you can see attached pic
best regards
@rnathan wrote:
TalendDate.formatDate(pattern, date) is the function you want. If you want TalendDate.formatDate("yyyy-mm-dd", myDateColumn) should give you want you want.
unfortunately - not always correct
formateDate return string @return the formatted time string.
this is why we ask - what format of column
in some cases it not important, but in some could be
1) if it DateTime to Date, all what need todo - just use proper format in tMap
2) if it string to string - just use substring for first 10 characters 🙂
3) for proper datetime to date convertios, need use use construction like
TalendDate.parseDate("dd-MM-yyyy",TalendDate.formatDate("dd-MM-yyyy HH:mm:ss",myDate))
I get the impression that you are new to this. When I asked for the schema, I meant the column types. What you have given does not give me anymore clues to what you need. The only way this can be resolved for you is if you can let us know whether the date is stored as a String (text) or a Date (an object that holds dates). To check this, go to your source component and open up the schema for that. Take a screenshot and post it here. Once you do that an easy answer can be supplied
hi @rhall
date source type datetime '2010-10-16 00:00:00' i want convert to simple date '2010-10-16'
best regards