23
23
use Magento \Framework \Message \ManagerInterface as MessageManagerInterface ;
24
24
use Magento \Framework \Phrase ;
25
25
use Magento \Framework \Serialize \SerializerInterface ;
26
+ use Magento \Framework \Stdlib \DateTime ;
26
27
use Symfony \Component \Console \Output \OutputInterface ;
27
28
28
29
/**
@@ -357,7 +358,7 @@ public function execute(string $code, ?OutputInterface $output = null)
357
358
$ isError = true ;
358
359
}
359
360
360
- $ this ->lastSuccessExecutedDate [$ this ->getCurrentJobClass ()->getFamily ()] = date (' y-m-d H:i:s ' );
361
+ $ this ->lastSuccessExecutedDate [$ this ->getCurrentJobClass ()->getFamily ()] = date (DateTime:: DATETIME_PHP_FORMAT );
361
362
362
363
// If last family, force proceed with after run steps
363
364
if (array_slice ($ productFamiliesToImport , -1 )[0 ] === $ family
@@ -689,7 +690,7 @@ public function setJobStatus(int $status, $job = null)
689
690
}
690
691
691
692
if ($ status === JobInterface::JOB_SCHEDULED ) {
692
- $ job ->setScheduledAt (date (' y-m-d H:i:s ' ));
693
+ $ job ->setScheduledAt (date (DateTime:: DATETIME_PHP_FORMAT ));
693
694
}
694
695
695
696
$ job ->setStatus ($ status );
@@ -713,7 +714,7 @@ public function beforeRun()
713
714
'akeneo_connector_import_start_ ' . strtolower ($ this ->currentJob ->getCode ()),
714
715
['executor ' => $ this ]
715
716
);
716
- $ this ->currentJob ->setLastExecutedDate (date (' y-m-d H:i:s ' ));
717
+ $ this ->currentJob ->setLastExecutedDate (date (DateTime:: DATETIME_PHP_FORMAT ));
717
718
$ this ->setJobStatus (JobInterface::JOB_PROCESSING );
718
719
}
719
720
@@ -747,7 +748,7 @@ public function afterRun($error = null, $onlyStop = null)
747
748
}
748
749
749
750
if ($ this ->currentJob ->getCode () === JobExecutor::IMPORT_CODE_PRODUCT ) {
750
- $ this ->currentJob ->setLastSuccessDate (date (' y-m-d H:i:s ' ));
751
+ $ this ->currentJob ->setLastSuccessDate (date (DateTime:: DATETIME_PHP_FORMAT ));
751
752
$ this ->currentJob ->setLastSuccessExecutedDate ($ this ->json ->serialize ($ this ->lastSuccessExecutedDate ));
752
753
753
754
if ($ this ->currentJob ->getStatus () === JobInterface::JOB_ERROR ) {
@@ -757,7 +758,7 @@ public function afterRun($error = null, $onlyStop = null)
757
758
758
759
if ($ error === null && $ this ->currentJob ->getStatus () !== JobInterface::JOB_ERROR ) {
759
760
if ($ this ->currentJob ->getCode () !== JobExecutor::IMPORT_CODE_PRODUCT ) {
760
- $ this ->currentJob ->setLastSuccessDate (date (' y-m-d H:i:s ' ));
761
+ $ this ->currentJob ->setLastSuccessDate (date (DateTime:: DATETIME_PHP_FORMAT ));
761
762
$ this ->currentJob ->setLastSuccessExecutedDate ($ this ->currentJob ->getLastExecutedDate ());
762
763
}
763
764
$ this ->setJobStatus (JobInterface::JOB_SUCCESS );
0 commit comments