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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

converting to unix timestamp for mysql

in a tmap i have to convert something like "02.08.08" into a unix timestamp to store it in a mysql database. can anybody give me a hint how to do that? i am quite new to java.
many thanks...
Labels (4)
3 Replies
Anonymous
Not applicable
Author

Hello
Set the data type as String for this column, then parse a string to a date.
Best regards
shong
0683p000009MCdD.png
Anonymous
Not applicable
Author

thanks but it does not give the right result:
i have :
02.08.2008 (string)
and i need to store:
1217635200 (long)
this is the result of:
long epoch = new java.text.SimpleDateFormat ("dd/MM/yyyy HH:mm:ss").parse("01/01/1970 01:00:00");
but i cannot use this expression in tmap as expression
any idea?
regards
....
Anonymous
Not applicable
Author

Hello
On tMap, try
(TalendDate.parseDate("dd.MM.yyyy",row1.date)).getTime()

Best regards

shong
0683p000009MCod.png