如何在yii2 php中获取服务器的日期时间

时间:2017-10-16 03:59:24

标签: php datetime yii2

GET是否有YiII服务器当前日期和时间的任何方式?

我找到的一个解决方案是

'created_at' => new \yii\db\Expression('NOW()'), But I don't know it's correct or not.

任何帮助都将受到高度赞赏。

1 个答案:

答案 0 :(得分:1)

您可以使用<mat-vertical-stepper> <mat-step label="Agreement Preparation"> <p>Agreement preparion is intiated by our side </p> </mat-step> <mat-step label="Ready for Biometric"> <p>Agreement preparion is intiated by our side </p> </mat-step> <mat-step label="Document in Submission"> <p>Agreement preparion is intiated by our side </p> </mat-step> </mat-vertical-stepper> date('Y-m-d h:i:s')通过php获取此信息,其中date($format)包含您想要时间的格式。默认情况下,此时间为您提供日期和时间。

您可以查看手册以了解要使用的格式: http://php.net/manual/en/function.date.php