KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Unix Epoch Timestamp Conversion #1072

Closed Rooze McKelvey opened this topic on on Sep 3, 2019 - 2 comments

Rooze McKelvey commented on Sep 3, 2019

I'm trying to display a timestamp field (that is currently in Unix Epoch Timestamp format) in a human-readable format.

This code isn't working:

                "Last Comment Date"=>array(
                    "label"=>"Last Comment Date",
                    "type"=>"datetime",
                    "format"=>"Y-m-d H:i:s",
"displayFormat"=>"d-m-Y D"
                ),

I'm assuming there's something else I need to do? TIA for the help.

David Winterburn commented on Sep 4, 2019

Hi Rooze,

Please try this code:

                "Last Comment Date"=>array(
                    "label"=>"Last Comment Date",
                    "type"=>"datetime",
                    "format"=>"U", //use "U" for Unix datetime format
                    "displayFormat"=>"d-m-Y D"
                ),

Let us know if it works for you. Thanks!

Rooze McKelvey commented on Sep 4, 2019

Works great; thank you!

KoolReport Is Free and Open-Source!

KoolReport is a professional php reporting framework which saves you tons of time to construct dynamic data report & dashboard.

  • Connect to various datasources such as MySQL, SQL Server, MongoDB or even from CSV or Excel file.
  • Contain series of powerful built-in data processes for your data manipulation.
  • Generate stunning charts and graphs to help you communicate data insights to your audiences effectively.
  • Integrate seamlessly with any php frameworks such as Laravel, CodeIgniter, Symfony.
Download Now and register our tutorials to get started!

Download KoolReport
solved

None