Question over 2038 years how does PHP handle it?1 Echo Date // The maximum integer that the date function can handle is 2147483647-"2038-01-19is 2 of the 31 square-1 to get 2147483647, if more than this value to do? If you still use date, this function will be messed up.Solution: Use the DateTime class1 $d=NewDateTime (' @2147493648 ');2 $d->settimezone (NewDatetimezone (' PRC '));3 Echo $d->format (' y-m-d
A simple phpCalender (calendar) solves the 2038 problem, which can be used on both 32-bit and 64-bit machines. The code is very simple and easy to modify.
A simple php Calender (calendar) solves the 2038 problem, which can be used on both 32-bit and 64-bit machines. The code is very simple and easy to modify.
Note that the 32-bit server has 2038 problem
Note 32-bit machines have 2038 issues, so the age range of 32-bit servers 1970 ~2038
We can also use DateTime to circumvent this problem (this has nothing to do with 32-bit 64-bit)
Copy CodeThe code is as follows:
/**** My Calendar* Date_default_timezone_set Date Mktime* @param int $year* @param int $month* @param string $timezone* @author Fc_lamp* @blog: fc-lamp.blog.163.com*/function Mycalender ($year =
PHP was later than the 2038 timestamp. A typical timestamp in PHP that is used to solve the problem of timestamp in November is from 20:45:54 GMT, January 1, to 03:14:07 GMT. (Solution for solving the problem with the 2038 timestamp in This PHP example
A typical timestamp of PHP is from 20:45:54, January 1, December 13, 1901 to 03:14:07, January 1, January 19, 2038
Recently in writing a project interface. The tests found a normal function on the server and there has been a problem locally. Step by step troubleshooting, the final locking problem is that the function Strtotime returns a false value, which causes the data to be inserted into the database failure.
The same code runs differently, because the environment is inconsistent. Either the PHP version is different or the number of digits is different.
This article mainly and you introduced the PHP conv
Note that 32-bit machine has 2038 problems, so 32-bit server life span 1970 ~2038 years
We can also use DateTime to circumvent this problem (this has nothing to do with 32-bit 64-bit)
Copy Code code as follows:
/**
*
* My Calendar
* Date_default_timezone_set Date Mktime
* @param int $year
* @param int $month
* @param string $timezone
* @author Fc_lamp
* @blog: fc-lamp.blog.163.com
*/
Another date problem, which results from computing dates into the year 2038 and beyond in 32-bit operating systems. UNIX and other C applications represent time as the number of seconds from January 1, 1970. the 32-bit variable (time_t) that stores this number overflows in the year 2038 and becomes January 1, 1970 again. however, even today, any date calculations forecasted beyond that time will be erroneou
Test instructionsGive a sequence, ask an interval, find the interval ... woc! Stick to the original question!As a rambling person, little Z spends a lot of time every morning looking for a pair to wear from a bunch of colorful socks. Finally one day, little z can no longer endure this annoying to find socks process, so he decided to resign to fate ...Specifically, small z to this n socks from 1 to n number, and then from the number L to R (L Although small z does not care about two socks is not
This article mainly introduces how to implement the Unix timestamp Conversion Function compatible with php after January 1, 2038. The method of use is the same as that of the function. It is very practical and recommended to everyone. I hope you will like it.
This article mainly introduces how to implement the Unix timestamp Conversion Function compatible with php after January 1, 2038. The method of use is
2038: [2009 countries Training team] small Z socks (hose) time
limit:20 Sec Memory limit:259 MBsubmit:7676 solved:3509[Submit] [Status] [Discuss]
DescriptionAs a rambling person, little Z spends a lot of time every morning looking for a pair to wear from a bunch of colorful socks. Finally one day, Little Z can no longer endure this annoying to find socks process, so he decided to resign to fate ... Specifically, little z numbered the n socks
PHP implementation compatible with the UNIX timestamp conversion function after 2038 years, 2038unix
Use the same method as the old function.
Copy the Code code as follows:function Fun_strtotime ($var 1=0, $var 2=0) {if (! $var 2) {$var 2 = $var 1;$var 1 = 0;}if (Is_numeric ($var 2)) {$var 2 = ' @ '. $var 2;}try{$date = new DateTime ($var 2);$date->settimezone (New Datetimezone (Date_default_timezone_get ()));}catch (Exception $e) {$date = 0;}if (Is_
Recently, the project needs to learn about flex and use filereference to upload files. The result is always reported #2038 error.
After checking for a long time, I finally found a lot of prompts here.
Io Error #2038
Http://swfupload.org/forum/generaldiscussion/92
One of them is like this.
Flash Io errors are not very helpful. The same couple of error numbers are returned for just about everything.Here are
October 01, 2014 PHP development 1 reviews read 264 times Datetime::format is designed to be unaffected by external settings (object oriented)So no matter how you change the environment parameter date_default_timezone, it will not affect the output resultTo change the Datetime::format time zone setting, you need toDatetime::settimezone Pass in a time zone object Datetimezone
1
$d=newDateTime(‘@2444486400‘);
2
$d->setTimezone(newDateTimeZone
PHP valid timestamp Typical range is GMT December 13, 1901 20:45:54 to January 19, 2038 03:14:07. (This range conforms to the minimum and maximum values of a 32-bit signed integer). However, this range is limited to some systems (such as Windows) from January 1, 1970 to January 19, 2038 before PHP 5.1.
The 64-bit system will not be affected if the 32 system can be resolved using the new datetime
The code
Ultraviolet A 2038-Strategic game (minimum vertex overwrite or tree DP in a bipartite graph)
Strategic game
Description
Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. now he has the following problem. he must defend a medieval city, the roads of which form a tree. he has to put the minimum number of soldiers on the nodes so that they can observe all the edge
Offline practices: Mo team.Offline processing of queries, the left end of the block, in the same piece of the right end of the order from small to large.Then, for the previous query [L,r] and today's inquiry [l ', R '] constantly adjust the range of intervals.How to adjust it? For the information contained in [L,r], we can adjust the time of O (1) to [L,r+1],[l,r-1],[l+1,r],[l-1,r].The most authentic Mo team seems to be the point set Manhattan distance plus the smallest spanning tree, very troub
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.