APIs & Integrations

oren_hac
Participante

How to convert hubspot timestamps to meaningful datetime?

resolver

Hi,

We're importing the hubspot DB to our BigQuery.

On the hs.properties.hs_lifecyclestage_marketingqualifiedlead_date.value property I see strange value such as: 1525801948522, 1525774682022.

I could not figure out what timestamp they represent? (These are not Unix timestamps)
I want to convert them to a datetime which I could actually use SQL queries on.

Does anyone have an idea?

Many thanks,
Oren

1 Soluciones aceptada
oren_hac
Solución
Participante

How to convert hubspot timestamps to meaningful datetime?

resolver

Replying to myself.
It is unix time - just need to divide by 1000.

Ver la solución en mensaje original publicado

4 Respuestas 4
Stanz
Participante

How to convert hubspot timestamps to meaningful datetime?

resolver

I know it's been three years, but I'm running into the same problem and I'm new to SQL. Can you show me how you've done this in BigQuery?

0 Me gusta
fsilva
Participante

How to convert hubspot timestamps to meaningful datetime?

resolver

Just use the Bigquery  TIMESTAMP_MILLIS  function 

 

In my case, the date from engagement table is a string so:

TIMESTAMP_MILLIS(CAST(created_at AS INT64))
0 Me gusta
oren_hac
Solución
Participante

How to convert hubspot timestamps to meaningful datetime?

resolver

Replying to myself.
It is unix time - just need to divide by 1000.

rentiner
Participante

How to convert hubspot timestamps to meaningful datetime?

resolver

I was breaking my head until I found your own answer

$date = date("Y-m-d H:i:s", ($date/1000) );