Epoch time conversion

Tags:

#1 bigfoot

I need to convert epoch time in seconds but get year 1970.

I have 1421079464 and epochconverter tells me it is

GMT: Mon, 12 Jan 2015 16:17:44 GMT
Your time zone: 12. jaanuar 2015 18:17:44 GMT+2:00

but when I use

Exec         if $raw_event =~ /\<TimeStamp\>(.+)\</ {$epochtimetmp = $1; $epochtime=integer($epochtimetmp)*1000; $EventTime = datetime($epochtime);}

I get: EventTime: 1970-01-17 12:44:39

Can somebody please tell me what is wrong here?

 

#3 adm Nxlog ✓
#1 bigfoot
I need to convert epoch time in seconds but get year 1970. I have 1421079464 and epochconverter tells me it is GMT: Mon, 12 Jan 2015 16:17:44 GMTYour time zone: 12. jaanuar 2015 18:17:44 GMT+2:00 but when I use Exec         if $raw_event =~ /\<TimeStamp\>(.+)\</ {$epochtimetmp = $1; $epochtime=integer($epochtimetmp)*1000; $EventTime = datetime($epochtime);} I get: EventTime: 1970-01-17 12:44:39 Can somebody please tell me what is wrong here?  

Quoting from the Reference Manual:

datetime datetime(integer arg);
description
Convert the integer argument expressing the number of microseconds since epoch to datetime.

I belive you need *1000000.