You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
moment js example format output: 2019-10-27T00:00:00+02:00
I send on post to php:
$test = new \Moment\Moment('2019-10-27T00:00:00+02:00');
print_r($test);
echo $test->format();
$test2 = $test->cloning()->addDays(1);
echo $test2->format();
============================================
Then i go default params on main function:
$test = new \Moment\Moment('2019-10-27T00:00:00','Europe/Madrid');
print_r($test);
echo $test->format();
$test2 = $test->cloning()->addDays(1);
echo $test2->format();
moment js example format output: 2019-10-27T00:00:00+02:00
I send on post to php:
$test = new \Moment\Moment('2019-10-27T00:00:00+02:00');
print_r($test);
echo $test->format();
$test2 = $test->cloning()->addDays(1);
echo $test2->format();
invalid output ===========
Moment\Moment Object ( [rawDateTimeString:Moment\Moment:private] => 2019-10-27T00:00:00+02:00 [timezoneString:Moment\Moment:private] => Europe/Madrid [immutableMode:Moment\Moment:private] => [date] => 2019-10-27 00:00:00.000000 [timezone_type] => 1 [timezone] => +02:00 )
2019-10-27T00:00:00+0200
2019-10-28T00:00:00+0200
============================================
Then i go default params on main function:
$test = new \Moment\Moment('2019-10-27T00:00:00','Europe/Madrid');
print_r($test);
echo $test->format();
$test2 = $test->cloning()->addDays(1);
echo $test2->format();
valid output ===========
Moment\Moment Object ( [rawDateTimeString:Moment\Moment:private] => 2019-10-27T00:00:00 [timezoneString:Moment\Moment:private] => Europe/Madrid [immutableMode:Moment\Moment:private] => [date] => 2019-10-27 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Madrid )
2019-10-27T00:00:00+0200
2019-10-28T00:00:00+0100
There is some way to do it compatible with default momentjs output?
(YYYY-MM-DDTHH:mm:ssZZ)
Thanks for support
The text was updated successfully, but these errors were encountered: