The SPTimestampsTrait
contains methods related to common date/time properties of SharePoint objects.
Get the creation time as a Carbon
object of a SPList
, SPItem
, SPFolder
or SPFile
object.
var_dump($object->getTimeCreated());
// object(Carbon\Carbon)#55 (3) {
// ["date"]=>
// string(26) "2000-01-01 00:00:00.000000"
// ["timezone_type"]=>
// int(3)
// ["timezone"]=>
// string(13) "Europe/London"
// }
Get the modification time as a Carbon
object of a SPList
, SPItem
, SPFolder
or SPFile
object.
var_dump($object->getTimeModified());
// object(Carbon\Carbon)#55 (3) {
// ["date"]=>
// string(26) "2000-01-01 00:00:00.000000"
// ["timezone_type"]=>
// int(3)
// ["timezone"]=>
// string(13) "Europe/London"
// }