Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
hechmi
Contributor III
Contributor III

how delete time from date

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

Labels (2)
14 Replies
vapukov
Master II
Master II

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 

rnathan2020
Contributor
Contributor

TalendDate.formatDate(pattern, date) is the function you want. If you want TalendDate.formatDate("yyyy-mm-dd", myDateColumn) should give you want you want.
hechmi
Contributor III
Contributor III
Author

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

rnathan2020
Contributor
Contributor


@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.

Anonymous
Not applicable

@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. 

hechmi
Contributor III
Contributor III
Author

@rhall

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 


data_source_input.PNG
date_want_out.PNG
vapukov
Master II
Master II


@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

0683p000009M0Gv.png

 

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

 

Anonymous
Not applicable

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 

hechmi
Contributor III
Contributor III
Author

hi @rhall

date source type datetime '2010-10-16 00:00:00'   i want  convert  to simple date '2010-10-16'

 

best regards


date_want_out.PNG