Generate DateTime Records

Six Stars

Generate DateTime Records

Hi,

 

I need a suggestion on how to generate Datetime Records: HH:mm.  In HH24 format or even HH12.

 

Thanks.

Rhoda

Tags (1)

Accepted Solutions
Forteen Stars TRF
Forteen Stars

Re: Generate DateTime Records

Did you try
TalendDate.formatDate("HH:mm", TalendDate.getCurrentDate())

TRF

All Replies
Six Stars

Re: Generate DateTime Records

Hi, I found a solution to generate datetime records however, I didn't want to have the seconds just HH:mm. Is there a way to get rid of the ss?
Forteen Stars TRF
Forteen Stars

Re: Generate DateTime Records

Did you try
TalendDate.formatDate("HH:mm", TalendDate.getCurrentDate())

TRF
Eight Stars

Re: Generate DateTime Records

U can generate any date type using Talenddate.formatdate
Forteen Stars TRF
Forteen Stars

Re: Generate DateTime Records

@rgranado, did this help you?
If so, thank's to mark your case as solved (Kudo also accepted).

TRF
Eight Stars

Re: Generate DateTime Records

Hi @TRF,
This is not a question posted by me. So cant accept your solution Smiley Sad
Six Stars

Re: Generate DateTime Records

Hi

sorry I couldn't reply so quickly.  

 

I have done those changes and I am familiar with those functions.  I believe the format is dictated by the database component.    

tmap.PNGtmap date functionstPostgresqlOutput.PNGdb component DB Typesdatetable.PNGoutput

There might not be any solution on this component but if you have an alternative I would be gladly to hear it.

 

Thanks

 

 

Four Stars

Re: Generate DateTime Records

@ rgranado

Talend appears to be processing as required.  That is the database query is showing 12:00:00. The problem is most likely the database itself and the default configurations it has in displaying the various data types. Check the query tool you are using and the default settings it has for displaying the time data type. If you require the database to save the time in a specific format you may need to look at a char field