General developer forum

Convert string date to date Moodle 3.3

 
Picture of André Gava
Convert string date to date Moodle 3.3
 

How can I convert MOODLE startdate and end date to date? 

this can be found at $PAGE->course then ->startdate or ->enddate but this is a string, I wish I could convert it to a specific date format;

 
Average of ratings: -
Gareth J Barnard
Re: Convert string date to date Moodle 3.3
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Probably not a string but a number being unixtime, so https://docs.moodle.org/dev/Time_API.

 
Average of ratings: -