Jump to content

Datetime field timestamp

Roberts R

Recommended Posts

Is there a way to got timestamp from FieldDatetime? Like $page->event_start->timestamp?
Lets say that I have datetime field that have following format 'd/m/Y' and I'm trying to get week number from given field. $datetime->date('W'); (returns : 01) but $datetime->date('W',$page->start_date) (returns: 03) but should be same.

There is workaround, but that just seems too much 🤨

$datetime->date('W', $datetime->stringToTimestamp($page->event_start, 'd/m/Y'));
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...