Converting a Unix timestamp to a readable date

Overview

This article explains how to convert a Unix timestamp to a readable date in a Talend Job.

 

Environment

This procedure was written with:

  • Talend Open Studio for DI 5.0-r72978
  • Data Integration releases: 4.2.3, 5.0, 5.0.2, 5.1.1
  • JDK version: Sun JDK build 1.6.0_26-b03
  • Operating system: Windows XP SP3

Talend verified this procedure to be compatible with:

  • Talend Open Studio for Data Integration releases: 4.2.3, 4.2.4, 5.0.0, 5.0.1, 5.0.2, 5.1.1, 5.1.2, 5.2.0

 

Procedure

A Unix timestamp is a series of numbers such as 13959.583,1330578363. As you can see, it is quite unreadable. This procedure explains how to convert it to a readable date or map it to the target system format.

 

Assume we have the following Unix timestamp in a file:

13959.583
1356854
1330578363

 

Create an example Job

Create a demo Job called ConvertUnixTime. The detailed Job settings can be seen below:

1_007.png

 

2_005.png

 

Execute the Job

Execute the Job. The following results are output to the console:

Starting job ConvertUnixTime at 14:47 01/03/2012.
[statistics] connecting to socket on port 3659
[statistics] connected
01-01-1970 11:52:39
17-01-1970 00:54:14
01-03-2012 13:06:03
[statistics] disconnected
Job ConvertUnixTime ended at 14:47 01/03/2012. [exit code=0]
Version history
Revision #:
2 of 2
Last update:
‎06-23-2017 05:50 PM
Updated by:
 
Labels (1)