Home Backend Development PHP Tutorial 怎么生成22位的时间戳

怎么生成22位的时间戳

Jun 13, 2016 pm 01:26 PM
format true

如何生成22位的时间戳?

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->echo number_format(microtime(true),12,'','');
Copy after login


我用这种方法,发现最后的4~6位总在几个数之间变动,不知道为什么?

------解决方案--------------------
为啥要22位的呀?有什么业务需求?
------解决方案--------------------
12位小数的意思,时间在变它怎么会不变啊。
------解决方案--------------------
microtime 的最小分辨率是“微秒”,如果你觉得最后几位连续性太差,就表示的机器比较慢
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 尊渡假赌尊渡假赌尊渡假赌

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)

PHP formats a GMT/UTC date/time PHP formats a GMT/UTC date/time Mar 21, 2024 am 10:41 AM

This article will explain in detail how to format a GMT/UTC date/time with PHP. The editor thinks it is quite practical, so I share it with you as a reference. I hope you can gain something after reading this article. Introduction to Formatting GMT/UTC Date/Time in PHP In PHP, formatting GMT/UTC date/time is crucial for correctly displaying and handling cross-time zone dates. This article will explain how to format a GMT/UTC date/time using PHP's DateTime class, as well as the various formatting options available. DateTime class The DateTime class represents a date and time. It can store and manipulate date/time values ​​in time zones such as GMT/UTC. To create a new Da

Detailed explanation of the meaning of true in PHP functions Detailed explanation of the meaning of true in PHP functions Mar 16, 2024 am 08:57 AM

Detailed explanation of the meaning of true in PHP function In PHP, true is a Boolean value, representing the state of &quot;true&quot; or &quot;yes&quot;. Using true in a function is usually used to express that a condition is true or to return a success status. This article will explain in detail the meaning of true in PHP functions from different perspectives, and give specific code examples. 1. Conditional judgment when true is returned: In PHP functions, true is usually used in conditional judgment to indicate that the condition is true. For example: functioni

What does true mean in PHP function? What does true mean in PHP function? Mar 16, 2024 pm 12:12 PM

Title: What does true mean in PHP functions? In PHP programming, true represents true in a Boolean value, usually indicating the state of &quot;true&quot;. When true is used in a function, it is usually used to determine whether a condition is true or to perform some operation. The following will use specific code examples to illustrate what true means in PHP functions. example:

What does format in python mean? What does format in python mean? Jul 31, 2023 pm 02:02 PM

format in Python is a string formatting method used to insert variables or values ​​into placeholder positions in a string. Through the format method, we can dynamically construct a string to contain different values.

What does format mean in python What does format mean in python Jul 31, 2023 pm 02:05 PM

In Python, `format` is a built-in function used to format strings. It is used to create a string template with placeholders and fill the placeholders with specified values. This allows strings to be constructed dynamically based on different situations, making the output more readable and customizable.

What is the usage of format in python What is the usage of format in python Jul 31, 2023 pm 01:59 PM

The usage of format in python is basic usage, specifying location, specifying variable name, formatting numbers, formatting date and time.

How to convert a string into formatted date and time in MySQL How to convert a string into formatted date and time in MySQL Jun 01, 2023 pm 09:22 PM

STR_TO_DATE(date, format): Convert the string into the date and time in format SELECTSTR_TO_DATE(‘2015-01-01’,‘%Y-%m-%d’)->2015-01-01

The difference and usage of equals() and == in Java The difference and usage of equals() and == in Java Mar 07, 2024 pm 03:28 PM

In Java development, there is a seemingly simple, but there are a lot of topics and questions on the Internet, that is, what is the difference between equals() and the == operator ==: The operator is used to compare whether the addresses of two objects are equal equals( ): method is used to compare whether the contents of two objects are equal. Today's content introduction, which takes about 9 minutes. To better understand this difference, let us look at an example: Stringstr1=newString("Hello");Stringstr2=newString(" Hello");System.out.println(str1.equals(str2));//output trueSystem

See all articles