Greeting, Bob, et al:
We have a report that currently displays a transaction id ('uxid'), which is a unix timestamp on the DB. Is there a way in CC to display this in human-readable form?
E.g., in custom code, I could use gmdate() or date() in PHP; if I could modify the MySQL query, I'd use something like FROM_UNIXTIME(uxid)
Thanks as always ~
Cliff
We have a report that currently displays a transaction id ('uxid'), which is a unix timestamp on the DB. Is there a way in CC to display this in human-readable form?
E.g., in custom code, I could use gmdate() or date() in PHP; if I could modify the MySQL query, I'd use something like FROM_UNIXTIME(uxid)
Thanks as always ~
Cliff
Hi Cliff,
You could use the PHP strtotime() method in the listing PHP box to do the conversion.
Bob
You could use the PHP strtotime() method in the listing PHP box to do the conversion.
Bob
Thanks, Bob -
So I'm in CC5, Front List, PHP Functions box, just in case that's not where you meant. I've tried multiple variations, but have been unable to et it right. Here's the latest syntax: (XtnArchived is a unix timestamp )
.... which results in the following error:
Parse error: syntax error, unexpected 'date' (T_STRING) in /var/www...
I gotta be close, right?
Thanks ~
Cliff
So I'm in CC5, Front List, PHP Functions box, just in case that's not where you meant. I've tried multiple variations, but have been unable to et it right. Here's the latest syntax: (XtnArchived is a unix timestamp )
Transactions.XtnArchived:return $cell date("H:i:s", [Transactions][XtnArchived])
.... which results in the following error:
Parse error: syntax error, unexpected 'date' (T_STRING) in /var/www...
I gotta be close, right?
Thanks ~
Cliff
Hi Cliff,
This bit has to be valid PHP
Bob
This bit has to be valid PHP
return $cell date("H:i:s", [Transactions][XtnArchived])
and it isn't. Please tryreturn date( "H:i:s", $cell['Transactions']['XtnArchived'] );
Bob
That got it - thanks as always!!
This topic is locked and no more replies can be posted.