Timezones for international web app in the zend framework - mysql

I have a web app which I want to work internationally.
I can ask each user their time zone and store it, no problem. Then I'm looking to store all dates in UTC and make the adjustments when transacting from the database.
Firstly, is this the best way to do it, or are there any other suggestions?
Secondly, does anybody know how best to convert the timezones when going to and from the database? Could I create some clever layer (in the zend framework) that does this automatically based on the php environment timezone, or would I need to update all of my queries?
Many thanks!

Zend_Date does all of this and much more .

Related

What is the best way to store timezone in Laravel Migrations

I need to store client's timezone.
Haven't found a way to write it to DB using migration (laravel 8.5).
The purpose is like just display current time depends on what timezone user have selected.
What is the best practice to store client's timezone?
Usually the better way is to use UTC timezone in app.config.php , save registered user's timezone in database and display the result accordingly.
Just check this nice blog https://qcode.in/managing-users-timezone-in-laravel-app/

Deciding what data model to use for simple time tracking app

I’m creating an app that is very simple in terms of the data it needs to store but as I am brand new to app development I’m looking for advice on what is the best method to store/retrieve/change the data.
It’s a very simple time tracking app and will need to manipulate the following data.
A record for each new day. For each day record it will need to store
Start work time /date
Start lunch time /date
End lunch time /date End
work time /date
Working day /bool
As the app will be used in conjunction with an existing time tracking process there is no need to store the ‘day’ record for longer than 3 months.
I’ve looked through some ways of storing data.
UserDefaults
CoreData
A local JSON file
I’m leaning towards a local JSON but wondered if it’s worth looking at the other options even if it’s just to learn how they work? To keep things simple, I want to try to do as much as I can with just Swift and Swift UI as that’s all I’m familiar with.
Also I’d like the app to automatically create a new day record (at the point a new day occurs) without the user having to do anything. I’m not sure if that makes a difference with the data approach.
Any advice most welcome!
If storing data inside phone local is enough for you, I recommend you to learn and use CoreData to keep it persistent. I do not think local JSON file enough for your application it is hard to keep your application persistent. I do not know UserData but I think you are talking about UserDefaults and it is useful for keeping small amount of data like userSettings or app status. For the future needs, I strongly recommend you to learn some server-side like frameworks like Vapor (you can write your server-side code using Swift language that you can adapt easily) or any other server-side frameworks.

Full Calendar advice for retrieving information from a database

Im using Full calendar to build a timetable that schedules around the users day to day activities. I am (trying) to pull values down from a mysql database and be able to insert them into the table. I am using jsp for this and i was wondering if anyone has any advice or a good structure to how i approach this? Im not looking for code or anything but just advice. How would I go about say getting the values from the database to the jsp and then onto the table?
I am here because I want to learn jsp. me not being the expert, I would say,
you need a database to store the dates and the events and you have managed to read the data and push the data on to the mysql database which is a good start.
Industry standard on interacting with database in the java world is hibernate(http://www.javatpoint.com/hibernate-tutorial), but it has steep learning curve.
on the client side jquery or someother javascript framework you have tons of it these days.
I do not know whether I solved your queries but it would be good if you ask queries in a way
I have done this ?
what I can do better ? with examples.
good luck :)

Sync database on ipad with remote database

I have an ipad app that has a database. I created a web-service on my mac mini using php,apache,mysql.
What I would like to do is sync the database on the ipad with the one I have on the remote computer maybe once everyday. Can someone please provide me with an example,sample code or even advice on how to go about doing this?
I would need more info to give you an accurate answer. What kind of database are you using ?
I can only give you a general answer since you really don't provide a lot of info,
What you would usually do when you need to send/request data from iOS to a Web Service, is send an HTTP Request using NSURLConnection or other wrapper classes such as AFNetwork.
Also the term "syncing" is quite a big subject, what do you mean by syncing? Always making sure the data on the iOS Database is the same as the web service database? If so you could have the client save some sort of E-Tag (last modified date), and ask the server only for data from that day onwards. Or the other way around, depends on the type of syncing you wish to accomplish.
I hope some of this makes sense for you, since your question was really general, my answer features a bit of general info , but might be helpful for you :)

Serialized data in a MySql Database to use in a Business Intelligence tool

I have a database (MySql) and need to store some results from a web service monthly.
The data can have 10 results today but may have 200 next month.
I need to use a BI tool to create charts and what not.
Someone proposed to serialize the data and save the blobs in the database, while the solution seems to work, I have a gut feeling that when the time comes to hook it up with the BI tool, hell will break loose.
Has anyone had this issue before?
Thanks
Edit: adding extra info.
The problem is that we haven't chosen the BI tool yet. But what it needs to do is create charts for the results. Some of the results come from Google Analytics. So we will be charting number of visitors to a site for the last 6 months. Or Number of viewed pages.
The answer is simple: do not store Serialized data in a database.
Do some research, atomize your data and create data structure.
Once you've done it, you will be able to use any BI tool in the world.
That's the purpose of a database and what distinguishes a database from a flat file.