Category Archives: daddyhunt mobile site

Just how to make use of JDate. Why don’t we examine the issue in front of you

Couple of days ago I made the decision to greatly help Yves having a datetime bug in Matukio ( dating back to to its “Seminar” origins). Every thing appeared to be hassle free. I have caused JDate in past times along with some knowledge about timezones. Therefore the challenge was taken by me convinced that we’ll invest 2h and every thing could be fine. Well, since it usually takes place a job that is 2h to be a single . 5 time task. (this can make an extremely good article about quotes, but we’ll accomplish that another time. )

Consumer A fills out a questionnaire, that has a field that stores a night out together

The thing that is best to accomplish once you shop the date when you look at the db is always to transform it to UTC. Why to UTC? Well that way you’ll have always a kick off point and|point that is starting} whenever you provide the production to your user you can include various timezones with regards to the users place. The key let me reveal to transform the date back once again to UTC. Happily JDate will help us with this. In the event that you glance at the JDate course inside you will discover that the constructor really expects 2 parameters -> the date therefore the timezone. Then when you conserve a night out together you’ll want to do generally something similar to this:

Now the relevant real question is -> how will you properly determine a timezone? Well, joomla helps us with this too. You can compose a little energy function that would seem like this:

Continue reading