Home Backend Development PHP Tutorial Solution to the time error obtained by PHP's date() function in the xampp integrated environment

Solution to the time error obtained by PHP's date() function in the xampp integrated environment

Apr 19, 2019 am 10:16 AM
date() xampp time error

This article mainly talks about the solution when the date() function obtains the wrong time. Friends who have the same problem can learn from it.

Date() gets the time error

Specific method:

 1. Open php.ini

 2. Search timezone

 3. Change to PRC

 4. Enter key

 5. Change to PRC

 6. Complete

I didn’t expect that such a small problem is also a big pitfall. I searched online for a long time and basically said that I need to modify this

But after I opened it, I found that the default time zone was already configured

I used this function after twists and turns

echo date_default_timezone_get();

I found that the default time zone is Europe/Berlin

Based on this keyword, I found a detailed graphic explanation of the PHP time zone settings in the xampp integrated environment

I found that there is another setting below

Changed to In this way, then restart Apache and it will run correctly

Related tutorials:PHP video tutorial

The above is the detailed content of Solution to the time error obtained by PHP's date() function in the xampp integrated environment. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1676
14
PHP Tutorial
1278
29
C# Tutorial
1257
24
XAMPP encountered PHP execution exception? Troubleshooting tips to help XAMPP encountered PHP execution exception? Troubleshooting tips to help Mar 12, 2024 pm 03:21 PM

In the technical field, XAMPP is a commonly used development environment tool. It integrates software such as Apache, MySQL, PHP and Perl, and can help developers quickly build a local server environment. However, sometimes when using XAMPP, you will encounter PHP execution exception problems, which may cause problems in development work. This article will share some troubleshooting techniques to help readers solve the problem when XAMPP encounters PHP execution exceptions. 1. Check the PHP error log. First, when the P in XAMPP

How to handle PHP date and time errors and generate corresponding error prompts How to handle PHP date and time errors and generate corresponding error prompts Aug 07, 2023 pm 09:55 PM

How to handle PHP date and time errors and generate corresponding error prompts Introduction: When developing and processing date and time related functions, date and time errors in PHP are often encountered. These errors may lead to program logic errors or page crashes, so we need to handle these errors appropriately and generate corresponding error prompts. This article explains how to handle PHP date and time errors and provides code examples. 1. Error types and causes When processing dates and times, common error types include: Invalid date format: When the incoming date

The solution to the problem that XAMPP cannot execute PHP is revealed The solution to the problem that XAMPP cannot execute PHP is revealed Mar 12, 2024 pm 06:39 PM

The solution to the problem that XAMPP cannot execute PHP is revealed. Specific code examples are needed. XAMPP is a very commonly used integrated development environment tool during website development or local testing. However, sometimes during the installation and configuration of XAMPP, you may encounter the problem that XAMPP cannot execute PHP, resulting in the website being unable to run normally. This article mainly provides a detailed introduction to the solution to the problem that XAMPP cannot execute PHP, including specific code examples. I hope it can help people who encounter similar problems.

How to solve the problem of wrong formatting time and minutes in php date How to solve the problem of wrong formatting time and minutes in php date Mar 23, 2023 pm 02:10 PM

When you use the date function in PHP to format time, you may find that the minutes being formatted are incorrect. This problem is usually caused by incorrect time zone settings.

Mastering these three comprehensive development tools is essential for PHP development Mastering these three comprehensive development tools is essential for PHP development Jan 13, 2024 pm 01:13 PM

Inventory of essential tools for PHP development: Mastering these three integrated development tools requires specific code examples. With the rapid development of the Internet, PHP, as a programming language widely used to develop websites and web applications, has attracted more and more developers. love. In order to improve development efficiency and quality, it is essential to use appropriate integrated development tools. In this article, we will take stock of the three necessary tools for PHP development and provide specific code examples for each tool to help developers better master and apply them. The first tool: PHPSt

Create a local web server using PHP and XAMPP Create a local web server using PHP and XAMPP May 11, 2023 pm 05:19 PM

With the continuous development of computer technology, the use of Web servers has become an indispensable part of people's daily lives. For programmers or web developers, using a local server is essential when developing and testing websites. PHP is a very popular scripting language for web development, and XAMPP is a commonly used server suite among developers. In this article, we will explain how to create a local web server using PHP and XAMPP. 1. Download and install XAMPP before starting to create this

What should I do if xampp cannot execute php? What should I do if xampp cannot execute php? Mar 23, 2023 am 09:17 AM

For users who use XAMPP for PHP development or debugging, they often encounter some problems, such as problems during the installation and configuration process, or running problems during use. Among them, one of the most common problems is that XAMPP cannot execute PHP. This problem may involve various factors, and today we will introduce some common solutions.

Causes and solutions of PHPCMS time errors Causes and solutions of PHPCMS time errors Mar 14, 2024 pm 04:09 PM

Causes and solutions of PHPCMS time errors When using PHPCMS to build a website, you may encounter the problem of time display errors, which may cause trouble to users and affect the normal operation of the website. This article will analyze the causes of PHPCMS time errors, provide relevant solutions, and attach specific code examples. 1. Causes of time errors PHPCMS time errors may be caused by the following reasons: 1.1 Incorrect server time settings Incorrect server time settings can cause P

See all articles