0

I'm using views php to printing, and calculate some dates in my view.but when I try to print a date (06/01/2015) in the global php field it printed like: 16831 which is the node id
Value code:

$load=$row->field_date_loading;
return $load;

Out put code:

echo $value;

1 Answer 1

0

use

$load = $data->field_field_date_loading[0]['raw']['value'];
echo $load;

if you are using an end date as well you can get it with:

$data->field_field_date_loading[1]['raw']['value'];
3
  • It doesn't work, nothing is printed
    – learner123
    Jul 23, 2015 at 7:51
  • oh it works only if i use the code in out put code without passing the $value variable.
    – learner123
    Jul 23, 2015 at 8:03
  • Works perfectly on a fresh install with drupal + views + views PHP. And you are suppose to put it in the output code.
    – DMAC
    Jul 23, 2015 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.