Hi

I suspect I'm just being dense here, and I apologise if so.

I'm simply trying to return the timestamp for a Date CCK field in a hook_nodeapi() function.

My field is called field_need_date_value.

I've tried:

$date = strtotime($node->content['field_need_date_value'];

and

$date = strtotime($node->field_need_date_value);

and

$date = strtotime($node->field_need_date_value[0]['view'];

but I can't get any of these to work.....

Thanks

Comments

glennnz’s picture

Solved

It's:

$date = strtotime($node->field_need_date[0]['value']);
arlinsandbulte’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

RobW’s picture

You can also create a custom date format with U as the format parameter string, and then set your field to your custom format in the manage display tab. This returns a unix timestamp.