KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

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!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

None