[SOLVED] Missing Unix Timestamp field type

Hello everyone !

I have a date field that is in UNIX Timestamp format.

But I cant see it as a date, only as a number. So I can't filter or work with date...

I checked this post but the solution is not there, and I have the same problem as his.

The UNIX Timestamp field is missing

my self-hosted metabase version is up to date

{
"browser-info": {
"language": "pt-BR",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 OPR/82.0.4227.50",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "Cp1252",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.11+9",
"java.vendor": "AdoptOpenJDK",
"java.vendor.url": "https://adoptopenjdk.net/",
"java.version": "11.0.11",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.11+9",
"os.name": "Windows 10",
"os.version": "10.0",
"user.language": "pt",
"user.timezone": "America/Sao_Paulo"
},
"metabase-info": {
"databases": [
"mongo",
"h2"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2021-12-16",
"tag": "v0.41.5",
"branch": "release-x.41.x",
"hash": "fbfffc6"
},
"settings": {
"report-timezone": null
}
}
}

Thanks!

Hi @arielss
You'll need to use Casting instead:
https://www.metabase.com/docs/latest/administration-guide/03-metadata-editing.html#casting-to-a-specific-data-type
Also I would recommend that you migrate away from H2 if you're using Metabase in production:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html

2 Likes

I'll migrate, thanks for the heads up.

Thats another problem, the UNIX is missing from Casting also:
mb2

@arielss What is the actual underlying data type? It looks like you're returning a string, but Unix Timestamp is supposed to be a numeric value. So make sure you're returning the correct type.

1 Like

Bulls eye :dart:

It was a String, now its an Integer and the UNIX isn't missing anymore.

Thanks @flamber !