Home Backend Development PHP Tutorial php 怎么获取一个时间的毫秒时间类似js的Date.UTC函数

php 怎么获取一个时间的毫秒时间类似js的Date.UTC函数

Jun 13, 2016 pm 01:22 PM
date unix

php 如何获取一个时间的毫秒时间类似js的Date.UTC函数
这个是js Date.UTC(2011, 10, 16,17,01)

php如何获取一个指定时间的毫秒时间如 2011-10-11 15:32 ,怎么得到他的unix时间戳精确到毫秒

------解决方案--------------------
time()
strtotime()
------解决方案--------------------
microtime -- 返回当前 Unix 时间戳和微秒数

------解决方案--------------------
mocrotime(true)返回的当前时间的微秒数。

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

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months 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 to create and name a file/folder based on current timestamp How to create and name a file/folder based on current timestamp Apr 27, 2023 pm 11:07 PM

If you're looking for a way to automatically create and name files and folders based on system timestamps, you've come to the right place. There is a super simple way to accomplish this task. The created folders or files can then be used for various purposes such as storing file backups, sorting files based on date, etc. In this article, we will explain in some very simple steps how to automatically create files and folders in Windows 11/10 and name them according to the system’s timestamp. The method used is a batch script, which is very simple. Hope you enjoyed reading this article. Section 1: How to automatically create and name a folder based on the current timestamp of the system Step 1: First, navigate to the parent folder where you want to create the folder,

What does GNU mean? What does GNU mean? Jan 02, 2019 am 11:53 AM

GNU is a Unix-like operating system developed and designed based on Unix and is compatible with Unix. GNU consists of a set of software applications and developer tools and a program that allocates resources and communicates with hardware or the kernel. GNU can be used with other kernels, and is usually used with the Linux kernel. GNU programs can be ported to many other operating systems, including different platforms such as Mac OS X and Microsoft Windows.

PHP Warning: date() expects parameter 2 to be long, string given solution PHP Warning: date() expects parameter 2 to be long, string given solution Jun 22, 2023 pm 08:03 PM

When developing using PHP programs, you often encounter some warning or error messages. Among them, one error message that may appear is: PHPWarning:date()expectsparameter2tobelong,stringgiven. The error message means: the second parameter of the function date() is expected to be a long integer (long), but what is actually passed to it is a string (string). So, we

What operating system is unix? What operating system is unix? Jan 05, 2021 am 10:26 AM

Unix is ​​a multi-user, multi-process computer operating system that supports multiple processor architectures. According to the classification of operating systems, it is a time-sharing operating system. In addition to being a network operating system, Unix can also be used as a stand-alone operating system. The UNIX system provides a good user interface, which is easy to use, fully functional, clear and flexible, and easy to expand and modify.

KDE Plasma 6.1 brings many enhancements to the popular Linux desktop KDE Plasma 6.1 brings many enhancements to the popular Linux desktop Jun 23, 2024 am 07:54 AM

After several pre-releases, the KDE Plasma development team unveiled version 6.0 of its desktop environment for Linux and BSD systems on 28 February, using the Qt6 framework for the first time. KDE Plasma 6.1 now comes with a number of new features t

Why are linux and unix similar? Why are linux and unix similar? Mar 13, 2023 am 10:20 AM

The original intention of Linux was to replace UNIX and optimize its functions and user experience. Therefore, Linux imitated UNIX (but did not plagiarize the source code of UNIX), making Linux very similar to UNIX in appearance and interaction. Therefore, it can be said that "UNIX is the father of Linux". It is precisely because Linux and UNIX are inextricably linked that people call Linux a "UNIX-like system."

Unix Philosophy Programming Principles Unix Philosophy Programming Principles Feb 20, 2024 am 10:54 AM

1Unix philosophy The Unix philosophy emphasizes practicality, comes from rich experience, and is not restricted by traditional methodologies or standards. This knowledge is more latent and semi-instinctive. The knowledge that Unix programmers accumulate through development experience can benefit other programmers. (1) Each program should focus on completing one task and start over when encountering a new task to avoid adding new functions to the original program, resulting in increased complexity. (2) Assuming that the output of a program will become the input of another program, even if the next program is not clear, make sure that the output does not contain irrelevant information. (3) Put the designed and written software into trial use as soon as possible, and discard low-quality code decisively and rewrite it. (4) Use tools prior to inefficient auxiliary means to reduce the burden of programming tasks and strive for excellence.

Introduction to methods and usage of using Date and SimpleDateFormat classes to process time in Java Introduction to methods and usage of using Date and SimpleDateFormat classes to process time in Java Apr 21, 2023 pm 03:01 PM

1. Introduction The Date class in the java.util package represents a specific time, accurate to milliseconds. If we want to use our Date class, then we must introduce our Date class. Writing the year directly into the Date class will not produce the correct result. Because Date in Java is calculated from 1900, so as long as you fill in the first parameter with the number of years since 1900, you will get the year you want. The month needs to be subtracted by 1, and the day can be inserted directly. This method is rarely used, and the second method is commonly used. This method is to convert a string that conforms to a specific format, such as yyyy-MM-dd, into Date type data. First, define an object of Date type Date

See all articles