user506259
user506259

Reputation: 601

Check if the datetime field is passed the current timestamp

I have a content type which has a required field named field_deadline. How do I check if field_deadline of nodes of this content type is greater than current timestamp (deadline has not been met yet)?

Upvotes: 0

Views: 924

Answers (1)

Coder1
Coder1

Reputation: 13321

if (strtotime($node->field_deadline['und'][0]['value']) > time()) {
  // deadline has not been met yet.
}

Upvotes: 1

Related Questions