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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Add date and time fields(both coming as source fields) into DATE TIME

Hi,

i would like to know how we can pass current date as GMT+1 in tMap, can anyone help me on it.?

Also how to add date and time fields(both coming as source fields) into DATE TIME in tmap?
thanks,

Labels (2)
6 Replies
Anonymous
Not applicable
Author

Hi
You can call the system functions defined in TalendDate routine to perform transformations on Date field. can you please show us some example data to explain your needs? 

Regards
Shong
Anonymous
Not applicable
Author

Hi,
Here is my example:
1) If source filed value is coming as blank or null, i should replace it with date time in GMT+1 format.
2) source fields are coming as date (dd-MM-yyyy) and time (HH:mm:ss), i need to concatenate Date + Time as one field before load into Target field(Date time).

Thanks.
Anonymous
Not applicable
Author

Hi
Try 
1) Link the input component to a tMap and do the transformatio, eg: assuming the data type of target column is String.

row1.c1==null||row1.c1.equals("")?TalendDate.getDate("dd-MM-yyyy HH:mm:ss"):row1.c1

2)Assuming the data type of coming fields are String, 

TalendDate.parseDate("dd-MM-yyyy HH:mm:ss", row1.date+" "+row1.time)

Regards
Shong
Anonymous
Not applicable
Author

Hi,

Thanks, both the below answers are useful for me. but small amendment to to my requirement;

1) i'm able to get the date time by using below expressions, but i need to get date time in GMT+1 format.
2) from the source both  date and time are in date time format, not string format. if date is coming as null from the source , i need to keep the value as "00-00-0000".

Thanks,
Anonymous
Not applicable
Author

Hi
1. What is the value you are getting now? What are you expected result?
2. Convert the source data to a string first, and then  concatenate the two string to a string, parse the string to Date to map the target column.


Regards
Shong
TRF
Champion II
Champion II

Hi,
You can easilly convert a datetime with a few lines of Java code, but you need to know the source and target timezone (for example Europe/Paris to GMT).
Also, have you think about daylight saving time?
What do you expect when asking for GMT+1 during summer and winter?
Regards,
TRF