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 - 2 comments

Rooze McKelvey commented on Sep 3

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

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

Works great; thank you!

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
solved

None