Posted by glennnz on November 17, 2009 at 8:40am
Jump to:
| Project: | Date |
| Version: | 6.x-2.4 |
| Component: | Date CCK Field |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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
#1
Solved
It's:
$date = strtotime($node->field_need_date[0]['value']);#2
#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
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.