JW217 Posted January 11, 2022 Posted January 11, 2022 I have created a custom profile field to store a date. However the date format is not correct like all the other dates in the database. I need to change the format it is stored. Currently the date gets saved in this format: CustomFields.5.fields.45.value 1641254400 I need it to save in this format: lastActivity 2022-01-11 Does anyone know of a way to correct this?
Marc Posted January 11, 2022 Posted January 11, 2022 It's a unix timestamp that its storing. Rather than looking in the database, what issue is it you are actually having on the front end? JW217 1
JW217 Posted January 11, 2022 Author Posted January 11, 2022 16 minutes ago, Marc Stridgen said: It's a unix timestamp that its storing. Rather than looking in the database, what issue is it you are actually having on the front end? Hi Marc, thanks for replying. I am using MiniOrange SSO for Wordpress that Bridges the login to Invision Forums and pulls fields into Wordpress Profile custom fields I created. One of those fields I want to grab is a custom date field in Invision - the date is being stored in a way that Wordpress doesn't convert to a proper format. Instead if formats it like "20220111" and I need it to be "01-11-2022". Invision database shows "1641254400" and the Wordpress database shows "20220111" I am using an auto-populate function to populate a gravity form - using a plugin from Gravity Wiz Auto Populate. Is there a way to get the invision custom date field to use a different format?
Solution Marc Posted January 11, 2022 Solution Posted January 11, 2022 Unfortunatly not, no. You would need customisation in order to achieve this. Its actually being stored correctly as per design of the software. If you wish for it to be converted elsewhere for display, you would need to perform that conversion JW217 1
Daniel F Posted January 11, 2022 Posted January 11, 2022 You could use the MySQL FROM_UNIXTIME method in your query https://webrewrite.com/convert-timestamp-date-time-format-mysql/ Marc 1
Recommended Posts