Table of Contents
回复讨论(解决方案)

php时间戳

Jun 23, 2016 pm 01:06 PM
php timestamp

        $time = strtotime(date('Y-m-d'));
        echo date('y-m-d h:i:s', $time);

为什么打出来
        16-05-17 12:00:00
        不应该是16-05-17 00:00:00


回复讨论(解决方案)

echo date('y-m-d  H:i:s', $time);

h 12 小时格式,有前导零 01 到 12 

当前时间:
echo date("Y-m-d H:i:s",time())

echo date('y-m-d  H:i:s', $time);

 

要这么逗比不?原因是?小写代表12小时制

拜托你看看手册

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 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)

How many digits are timestamps in php How many digits are timestamps in php Mar 21, 2023 pm 05:16 PM

The timestamp refers to the number of seconds from 0:00:00 on January 1, 1970 to the present. In PHP, you can obtain the current system timestamp through the time() function, or convert a time string into a timestamp through the strtotime() function. So, how many digits is the PHP timestamp?

PHP timestamps usually have several digits PHP timestamps usually have several digits Mar 06, 2023 pm 06:55 PM

PHP timestamps are generally 10 digits. Method for calculating the number of digits in a PHP timestamp: 1. Use the time() function to obtain the current timestamp. The syntax "$time = time();" will return the integer value string of the UNIX timestamp; 2. Use the strlen() function Just find the length of the timestamp, the syntax is "$len=strlen($time);".

A brief discussion on the method of converting time into timestamp in PHP A brief discussion on the method of converting time into timestamp in PHP Mar 24, 2023 am 10:57 AM

With the continuous development and popularization of the Internet era, Web development technology is constantly being applied and explored by people. As a commonly used web application development language and a widely used server-side scripting language, PHP is favored and used by more and more web developers. In PHP development, time management is also a very important issue. This article will introduce how to convert time into timestamp in PHP.

How to convert 13 digit timestamp to standard timestamp in php How to convert 13 digit timestamp to standard timestamp in php Mar 22, 2023 pm 04:33 PM

PHP is a very popular programming language used by many people to develop web applications and websites. When dealing with timestamps, you may need to convert the 13-digit timestamp to a standard timestamp. In this article, I will show you how to convert a 13-digit timestamp to a standard timestamp in PHP.

How to convert 13-digit timestamp in PHP How to convert 13-digit timestamp in PHP Mar 21, 2023 pm 05:00 PM

In PHP, timestamp is a very commonly used concept. A timestamp can be used to record the specific time when an event occurs. It usually consists of the year, month, and day representing the date, and the hour, minute, second, millisecond, etc. representing the time. In PHP, we can use timestamps to operate and calculate time. However, under the POSIX standard, the timestamp length is only 10 digits. If you need to save millisecond-level times, you need to use a 13-bit timestamp. So, if you need to convert a 13-digit timestamp in PHP, how to do it?

How to convert timestamp to day of week using php How to convert timestamp to day of week using php Mar 21, 2023 pm 05:16 PM

When developing web pages and applications, time is often a very critical factor. The PHP language provides many functions for time processing, among which the timestamp function is one of the most commonly used functions. A timestamp is a number that represents when an event occurred. Typically, the timestamp is the number of seconds since January 1, 1970. PHP provides functions that convert timestamps into human-readable date formats, such as the date() function. But what if we need to convert the timestamp into a day of the week? This article will introduce how to convert timestamp to star using PHP

How to convert 'year, month, day' into timestamp in php How to convert 'year, month, day' into timestamp in php Mar 28, 2023 pm 04:55 PM

With the continuous development of Internet technology, PHP has become a very popular web development language. In PHP development, timestamp is a very important data type. In some applications that need to calculate date and time, using timestamps can greatly simplify code writing and maintenance, and improve code performance. In this article, we will detail how to convert year, month and day into timestamp.

A brief analysis of timestamp conversion and time zone settings in php A brief analysis of timestamp conversion and time zone settings in php Mar 23, 2023 am 09:17 AM

PHP is one of the most popular server scripting languages ​​used for web development, especially dynamic web development. With the popularity of mobile Internet, timestamps have become more and more common in web development, so converting timestamps into date and time in a specific format in PHP is a very important skill. This article will introduce how to convert timestamps in PHP, as well as time zone settings.

See all articles