how to change time zone in kiwiTCMS? - kiwi-tcms

i change the time zone first, and then restart the service, but the time is still the UTC time
TIME_ZONE = 'Asia/Shanghai'
how can i change it?


You can't. The application doesn't support time zones and the docker image is configured for UTC. If you configure the host time to be UTC then the timestamps displayed in the web interface should be correct.

Related

Timezone calculation in laravel application

There are a lot of Geo-device data in my database. The data is stored with the timestamp in UTC which is 5 hours 45 minutes behind in my laravel application.
I have configured the timezone to 'timezone' => 'Asia/Kathmandu', in my config/app.php file.
Now, every time I insert the data I need to subtract the query with 5:45and add 5:45 while sending to the view. Is there any configuration or any other methods that can act as there is no lagging in time?

How to make my React application automatically make an entry in the database at 00:00 hours (I.E. when its a new day)?

I am using axios in my React App and i have the following code ::-
axios.put(`Dates/${ todaysDate.getFullYear() }/${ this.utilMonthInAlpha(todaysDate.getMonth()) }/${ ( todaysDate.getDate() > 9 ) ? todaysDate.getDate() : '0' + todaysDate.getDate() }/.json` , {
goodHabits : userStoredHabits,
totalScore : '0'
});
The above code is in my componentDidMount lifecycle hook , so everytime the user loads the application the above code is executed, in my google firebase database the entry looks like below:
Now i want the data to be entered for each day of the month irrespective of weather the user accesses my application or not , so how do i go about doing that ? so you can see from the 5th - 9th when the user has not accessed the application the entry is not made, so how do i make my React application automatically make an entry in the database ?
Ideally for example today is the 9th and its around 7:37 PM , so as soon as the clock strikes 00:00 and its the 10th i would like my application to automatically make an entry into the database, how do i do this ?
On the server
If you want your database to be updated while your user is not using your app, you will have to run something on a server to update it.
You could use a Cloud Function that updates your database in response to an hourly Cloud Pub/Sub trigger.
You could store the users' time zones and execute the database updates from the function only when the hourly job is run closest to midnight in the user's time zone.
Setting up cron jobs can be done using the functions-cron package. The readme includes instructions on setting up an hourly job.
https://github.com/FirebaseExtended/functions-cron
In the app
Does it really matter for your app that the database gets updated every day at midnight? Perhaps your app can query the database when it is opened, and check which updates have been missed, and send them all to the database then.

How to synchronize backend timer with mobile app

I am developing a app that chooses a user and has a 15 sec. timer for that user to respond. The user app queries the db every 5 sec to see if that user is chosen. If so The mobile app begins a 15 sec. timer. The problem is that the timers will never match up because the user app can be on a different timer cycle that the backend and can query the db at a later time. I use Angular, NodeJS, and expressJS + MongoDB to develop this app.
any suggestion on how I can get the timers to be synchronized?
You need to create API for requesting current server time and use that server time as basis of your timer.
You also need to take into account condition when browser pauses javascript execution. This is true for mobile device. When mobile device is paused/sleep, browser stops javascript execution causing timer not sync anymore.
Every tick, check last tick millisecond with current tick millisecond. If difference is greater than some threshold value then assume timer not sync anymore and need to be sync by requesting current server time and recalculate timer value

Is it normal my heroku app postgres database and my local time having distinct datetime?

I'm experiencing an issue with a rails app deployed to heroku, actually I don't know if it's totally normal or if there's something wrong.
So, I dug a little bit into the web and I found that setting timezone into heroku app with $ heroku config:add TZ="America/Sao_Paulo" could help, but it didn't help that much.
Eg.: While a recent created object created_at appears like "2016-10-22 22:04:20" my local datetime at the moment was "Sat Oct 22 20:04". That's two hours apart.
Rails always stores time in UTC by default. This is to avoid confusion when changing to different time zones. Adding changes to config files, will not reflect while storing data in database.

How to see fresh logs in appengine dashboard?

I'm using AppEngine for some small web application. However, the logs I see in the appengine dashboard are always 30 mins to a few hours old. Is there any way to see "fresher" logs? Thanks.
I have an appengine app and there too the latest log now is 33 mins old. I suspect it takes a while for events to get there. It appears to me there can't be a way to modify this. But make sure first that you choose the correct Time Zone from the dropdown menu. I noticed it affects the time of the latest log.
This might be a bug in Google App Engine.
Here is a workaround taken from this response in the previous link:
I found that changing the timezone to PST shows the freshest logs.

Resources