It’s currently possible to display milliseconds when configured one column at a time. Is it also possible to configure this for all datetime columns globally?
Even if it’s not possible from the admin dashboard etc, a nudge towards where it’d be possible to change this in the codebase for a custom build would be useful as well.
Hi @scosta
It would probably be easier to create a script that just runs through all the “fields” rows of your metadata database.
Have a look in table metabase_fields and set column settings to {"time_enabled":"milliseconds"} where base_type is type/DateTime.
You can also do this manually via Admin > Data Model > (database) > (table) > (column) > Formatting
EDIT: I’ve tried to modify the global setting, but it doesn’t work with the time formatting - haven’t checked the code, but guess it doesn’t make a lookup globally.
Hi @flamber, thanks for the details! I was able to change the fields as you suggested, however it looks like those settings are only applying with “Custom” query types and not with “Native query” query types.
@scosta
Yes, when you do a native query, it’s the returned casting that defines what formatting is provided.
Example, let’s say you have a field created_at in your Data Model, which is a Timestamp in your database, but you could do anything to that column in SQL:
SELECT CAST(created_at AS date) AS ThisIsOnlyDate FROM table
You could have your script go through the table report_card modifying visualization_settings, but that’s going to be much more difficult, since you need to inject the "time_enabled":"milliseconds" into specific positions.
So if you need it to be totally global, it would probably be easier to change the formatting code and compile your own version.