Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics

Date column: unable to use custom format


I added to my user table a “last_login” column.

Updated using: update_user_meta($user->ID, 'first_login', \Carbon\Carbon::now()->format('d/m/Y H:i:s'));
Also tried with: update_user_meta($user->ID, 'first_login', \Carbon\Carbon::now()->timestamp);

I then used as date format “d/m/Y H:i:s” and “u”: nothing is displayed in column. I have to remove the “date” format to have the raw text value displayed.


1 year, 8 months ago

Edit: my example use “first_login”, but my tests are with “last_login”, and from database user_meta table, values are OK and match the defined format.

1 year, 8 months ago

So just to be sure.
You’ve used our custom field column with type set to ‘Date’?
When the actual value is of the meta field is a timestamp, I expect the display value should work without any problem. But when your value is stored as ‘d/m/Y H:i:s’ I suspect it will not work as intended.
The best format for in the database in my opinion is a timestamp or ‘Y-m-d H:i:s’ format. Both formats can also be used natively to sort and filter in the database, so not only for Admin Columns but probably other features as well, I recommend to use one of those.

But if the timestamp is not working as expected, I’m curious why it doesn’t work. Can you contact me at and send me a screenshot of your column settings for this specific column you’ve setup?

1 year, 8 months ago

You must be logged in to reply to this topic.