Closed chisoft-io closed 1 year ago
Hi @chisoft-io, thanks for using the SDK!
$startdate->date->start
is an DateTimeImmutable
object. It is a PHP standard object and you can find all the properties and methods exposed by this class on the official PHP documentation.
To transform it into a string, you could use the format()
method. For the desired date format, I would use:
$startdate->date->start->format("Y-m-d H:i:s");
Thanks for creating the Notion SDK PHP, nice work! This is only a potential bug, more likely my lack of understanding how the API works. I'm grateful for some advice.
Describe the bug I have a Notion page with a database. I'm able to retrieve various properties of the database like for expl. ->number as explained under Get page property. But I'm unable to access the ["date"] string of the Date property.
To Reproduce
object(DateTimeImmutable)#156 (3) { ["date"]=> string(26) "2023-08-26 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Zurich" }
NULL
Expected behavior
2023-08-26 00:00:00
Code snippet See above
Environment (please complete the following information):