search
HomeBackend DevelopmentPHP ProblemHow to convert Julian day count in php calendar to Unix timestamp

In the previous article, we learned what the French Republican Calendar is, what the Julian Day is, and we also know how "php Calendar's Julian Day Counting and the French Republican Calendar Date Periods" Mutual conversion》, this time let’s take a look at how Julian day counts are converted to Unix timestamps.

Today we will continue this topic to learn other functions in the PHP calendar, but before starting this article, I want to ask you a question. This question is, do you know the Unix timestamp? In order to prevent some friends from not knowing, let’s first explain Unix timestamps.

The unix timestamp is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), regardless of leap seconds.

According to the ISO 8601 specification, the 0 of the UNIX timestamp is: 1970-01-01T00:00:00Z.

The UNIX timestamp format of one hour is: 3600 seconds; One day is expressed as a UNIX timestamp of 86400 seconds, and leap seconds are not counted.

In most UNIX systems UNIX timestamps are stored as 32 bits, which can cause the year 2038 problem or Y2038.

After understanding the relevant knowledge of Unix timestamps, let’s officially start our introduction.

As usual, let’s start with a small case.

It is now known that the Julian day count is 2440590, so what is the Unix timestamp?

Next let’s look at the code:

<?php
echo jdtounix(2440590);
?>

The result is

172800

In this example, we can see that the jdtounixh function is used , follow the case and look at the function to see if you can roughly understand what the function does. In fact, it is very simple. The jdtounixh function converts one number into another number. Now that we know this, let's take a closer look at this function.

Syntax

jdtounix(介于2440588和2465342之间的儒略日数字);

The jdtounix() function converts a Julian day count to a Unix timestamp.

Special attention should be paid to:

If the parameter jd is not in the Unix new era (meaning that the Gregorian year must be between 1970 and 2037, or jd >= 2440588 and jd ), the function will return false. The time returned is local time.

Here are the php knowledge you want to learn→php video tutorial

The above is the detailed content of How to convert Julian day count in php calendar to Unix timestamp. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function