B
B
bizzonaru2017-02-11 12:26:32
Yii
bizzonaru, 2017-02-11 12:26:32

How to save the date without UTC, but just according to the current timezone?

I use the extension to mongo, I do it like this now

$collection = Yii::$app->mongodb->getCollection('visitors');
        
        $collection->insert([
            'created_at' => new UTCDateTime(round(microtime(true) * 1000)),
            'user_ip' => Yii::$app->request->userIP,
        ]);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question