I Love PHPMaker

... because it gets even more powerful and flexible!!

  • About
  • Terms and Conditions
  • Membership Options
  • Sitemap
  • Downloads
    • PHPMaker Extensions Download
    • PHPMaker Projects Download
    • PHP Report Maker Extensions Download
I Love PHPMaker » Tips and Trick » How to Overcome Timezone Issue in Websites that Generated by PHPMaker 9.2.0
How to Display Records on Daily Basis in Websites that Generated by PHPMaker 9.2.0
How to Define Default Search Value in Advanced Search of Websites that Generated by PHPMaker 9.2.0

July 25, 2013

How to Overcome Timezone Issue in Websites that Generated by PHPMaker 9.2.0

Have you ever experienced something strange when creating the web applications that generated by PHPMaker which use multi-language and the Timezone is other than GMT? If you look closely at the Date and Time when the data from the database is displayed, then the value will be converted twice from the original GMT Date and Time. Still confused what I meant? Let's take a look at the example below.

The Timezone that you use both for the web application and the web server is Asia/Jakarta (GMT+7), and the Date and Time of data is saved to the server correctly according to the date and time when user input the data as 2013-07-25 10:48:30. When this data is displayed on the List and View pages, then it will be displayed as 2013-07-25 17:48:30. I think this explanation is clear enough now.

To fix the problem, then I will show you how you can overcome this issue easily using Server Events of PHPMaker. So, in that case above, it will be displayed as 2013-07-25 10:48:30.

[hidepost]

  1. Open your PHPMaker project (.pmp) file using PHPMaker application.
  2. Click on your desired table from the Database pane in the left side, then click on Code (Server Events, Client Scripts and Custom Templates) tab, and then expand the following section: Server Events -> Table-Specific -> List Page -> ListOptions_Load function, and then insert the following code into the function:

        // This will get the original value of datetime value from any datetime field database
        // since the Regional Settings in server is "Bangkok (GMT+7)" and the timezone setting
        // in .xml language file is "Asia/Jakarta".
        // If we don't change the default timezone to GMT, then the datetime that will be displayed
        // in the List page will always GMT+7. So strange, right?
        date_default_timezone_set("GMT");
    

    This will convert the data back to the real one when it is displayed in the List page.

  3. Do the previous step also for the following section: Server Events -> Table-Specific -> View Page -> Page_Load function. Make sure you do not miss this step since this will convert the data back to the real one when it is displayed in the View page.
  4. Finally, re-generate your script files using PHPMaker as always. 🙂

[/hidepost]

Article by Masino Sinaga / Tips and Trick / GMT, GMT+7, multi language, PHPMaker 9.2.0, Regional Settings, Timezone Leave a Comment

How to Display Records on Daily Basis in Websites that Generated by PHPMaker 9.2.0
How to Define Default Search Value in Advanced Search of Websites that Generated by PHPMaker 9.2.0

Leave a Reply Cancel reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • A New PHPMaker 2025 Project File Is Released
  • PHPMaker 2025 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2025 Is Released!
  • A New PHPMaker 2024 Project File Is Released
  • PHPMaker 2024 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2024 Is Released!
  • PHPMakerProjects.com, For Those Who Need PHPMaker Project Sample
  • A New PHPMaker 2023 Project File Is Released
  • PHPMaker 2023 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2023 Is Released!

Search

Recent Comments

  • Masino Sinaga on Masino Extensions for PHPMaker 2024 Is Released!
  • Masino Sinaga on A New PHPMaker 2024 Project File Is Released
  • Masino Sinaga on PHPMaker 2023 Demo Project File Is Released
  • Edward Babatunde on PHPMaker 2023 Demo Project File Is Released
  • Edward Babatunde on Masino Extensions for PHPMaker 2024 Is Released!

Demo Website

  • Demo of I Love PHPMaker 2025 (MasinoExtensions).
  • Stock Inventory Management for PHPMaker 2025.

Another Demo

The following template are not available in this site (must be purchased separately)

  • PHPMaker v2018 Horizontal Vertical Template.
  • PHPMaker v2017 Horizontal Vertical Template.

Demo Explanation

Stock Inventory Management is the good project for your reference, since it uses the real example in the real world. Many useful features you can use from this project, such as how to add the Thousand and Decimal separator character, and also how to calculate multiple row in Grid-Add when End-Users are entering data into the Grid-Add mode.

Categories

  • Customize Template (103)
  • General (4)
  • PHP Report Maker (17)
  • PHP Report Maker Extensions (2)
  • PHPMaker Extensions (84)
  • PHPMaker Projects (7)
  • Tips and Trick (72)

Articles based on version

  • PHPMaker 2025
  • PHPMaker 2024
  • PHPMaker 2023
  • PHPMaker 2022
  • PHPMaker 2021
  • PHPMaker 2020
  • PHPMaker 2019
  • PHPMaker 2018
  • PHPMaker 2017.0.7
  • PHPMaker 12.0.7
  • PHPMaker 11.0.6
  • PHPMaker 10.0.5
  • PHPMaker 9.2.0
  • PHPMaker 8.0.3
  • PHP Report Maker 12

(c) I Love PHPMaker 2010 - 2025 by Masino Sinaga | WordPress | Log in | Back to top