Answer the question
In order to leave comments, you need to log in
How to take only the time from a DateTime object?
When executing a query, a datetime field returns an object of the datetime type with the following properties: date, timezone_type, timezone.
How to get only time? I tried to work with it as an ordinary object: $row['STARTTIME']->{'date'}
But nothing happened, I also tried to work with it as with a regular array.
Also wanted to do this in sql query:
SELECT CAST(STARTTIME AS TIME) AS STRT FROM tableName
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question