Answer the question
In order to leave comments, you need to log in
How to correct the output from the date and time database on vue + laravel?
Good day!
Can someone tell me what the problem is?
Site on Laravel (backend) + Vue (frontend).
The current date is written to the database through Laravel - Carbon::now()
In the Lara timezone settings Europe/Moscow is set
The date is written correctly to the database - for example 2020-09-16 08:20:32
But on the site from the database, the time is 3 hours less, those. 05:20
In xampp added
1) In httpd.conf (\xampp\apache\conf\httpd.conf):
SetEnv TZ Europe/Moscow
2) php.ini (\xampp\php\php.ini) :
date.timezone = "Europe/Moscow"
3) In my.ini (\xampp\mysql\bin\my.ini)
default-time-zone = "Europe/Moscow"
restarted servers
But the time still shows minus 3 hours on the site.
Moreover, when I used pure Laravel (without vue) in another project, it was enough to change the time zone in Lara's config and everything was correct on the site without manipulating xampp.
Maybe vue needs something?
Tell me pliz
Answer the question
In order to leave comments, you need to log in
Everywhere you write UTC. On the server, for PHP, for the stall. In VueJS, you take and convert the date to the desired one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question