Roberts R Posted January 13, 2020 Share Posted January 13, 2020 Hello 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 More sharing options...
bernhard Posted January 13, 2020 Share Posted January 13, 2020 https://processwire.com/api/ref/page/get-unformatted/ $timestamp = $page->getUnformatted('event_start'); 1 2 Link to comment Share on other sites More sharing options...
Roberts R Posted January 16, 2020 Author Share Posted January 16, 2020 Thanks, that works. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now