CodeIgniter Forums
How can I access the date from an object (new Time('+1 day') ? ) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: How can I access the date from an object (new Time('+1 day') ? ) (/showthread.php?tid=79479)



How can I access the date from an object (new Time('+1 day') ? ) - Steven Dev - 06-22-2021

Hello colleagues !

Unable to access "date" from new Time ('+ 1 day').
I try with this code:
Code:
$myTime = new Time('+1 day');
var_dump($myTime->date);

CodeIgniter\I18n\Time Object
(
    [timezone:protected] => DateTimeZone Object
        (
            [timezone_type] => 3
            [timezone] => Europe/Sofia
        )

    [locale:protected] => bg
    [toStringFormat:protected] => yyyy-MM-dd HH:mmConfuseds
    [date] => 2021-06-23 15:39:19.000000
    [timezone_type] => 3
    [timezone] => Europe/Sofia
)


RE: How can I access the date from an object (new Time('+1 day') ? ) - php_rocs - 06-22-2021

@Steven Dev,

Maybe this will work better for you... https://stackoverflow.com/questions/1394791/adding-one-day-to-a-date


RE: How can I access the date from an object (new Time('+1 day') ? ) - Steven Dev - 06-22-2021

Thank you @php_rocs realy i can use this.