English 中文(简体)
PHP DATE strtotimedate “0001-01” [duplicate]
原标题:PHP DATE strtotime date "0001-01-01" [duplicate]
  • 时间:2011-10-03 07:43:09
  •  标签:
  • php

Hello guys有办法将0001-01-1日期改为时间格式? 我正试图利用网站strtotime(“0001-01”),但这种功能是假的。

我的目标是从日期起算:0001-01<>/strong>到:2011-01

问题回答

使用日期: 在你看来,固定时间返回是不受约束的。

正如Ignacio Vazquez-Abrams评论的那样,在通过格雷格斯日历之前的日期可能会有问题:

  • The Gregorian calendar was adopted at different times in different countries (anywhere from 1582 to 1929). According to Wikipedia, a few locales still use the Julian calendar.
  • Days needed to be "removed" to switch to the Gregorian calendar, and the exact "missing" dates differ between countries (e.g. the missing days in September 1752). Some countries tried to do a gradual change (by removing February 29 for a few years); Sweden switched back to the Julian calendar to "avoid confusion", resulting in a year with February 30.
  • Years were not always counted from January 1 (which has left its legacy in things like the UK tax year).

http://www.Michael Portwood.com/Fun-Facts/Disappearing-Days.htm “阿马齐格人不满日提供了合理的摘要。

简言之,你们必须确切地知道“1月1日......日......日”对你的提问意味着什么。 天文学家使用Julian Day Number(与朱利安日历不完全相关)来避免这一问题。

http://www.un.org。 当事情要求使用“proleptic Gregorian历”时,你甚至必须小心。 这是假定的,即: Gregorian历经后继,但在16年前的年份, Sym遵守旧的年限规则(即, Sym虫的“1200年”不是一个跳跃年,在代乐素的 Gregorian历程中是这样)。

我担心的是,它赢得工作,因为随着时间长度的变化,其价值最低,为0,而1970-01年。

date( Y-m-d , 0);

我们不能这样做。 这里可以选择如何做到这一点。

$date1= "2011-01-01";
$date2 = "2011-10-03";

//calculate days between dates

$time_difference = strtotime($date2) - strtotime($date1); 

现在,你在从你掌握的二秒钟上可以有天、小时、分钟、秒钟。

手册:

如果用两种数字格式说明该年度的数字,那么2000-2069年和70-99至1970-1999年的数值为00-69。 关于32个轨道系统的可能差异,见以下说明(可能的日期可于2038-01-1903:14:07)。

您不妨提供<代码>。 日期:www.createFromFormat a fire rather , ∗ ∗

还指出,对于32个轨道版本的购买力平价,你不能低于1901年。

由于这项职能从1970年开始恢复一个时间档和时间印章,你可以不时地利用这一职能,因此建议你以不同的方式ear耳光。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...