On the issue of time stamp comparison
In the database, I store the data in timestamps (Time ())
Now I'm going to use a date like 2012/8/22 to query
But there's a problem with the scale.
What can I do to find out all the data in the database that equals today?
------Solution--------------------
SELECT * from TT WHERE f
, the Easter date of the year is returned in UNIX time stamp format. if the year is not input, the date of the year is calculated. Value? Note that the input year must be between 1970 a.m. and 2037 a.m.; otherwise, it cannot be calculated. Example
Echo date ("M-d-Y", east
y h: I: s", mktime ));
?>
If the machine running this example is in Finland (Finland, GMT + 0200), the returned result is:
Jan 01 00:00:00 1998
Dec 31 1997 22:00:00
Refer to date () mktime () gmmktime ()
Easter_date is used to calculate the Easter date.
Syntax: int easter_date (INT [year]);
Return Value: integer
Function Type: time and
Timestamp
Time
Returns the current UNIX timestamp.
System Time Zone settings
During the learning process, we found that the time obtained through the date () function is different from the local time. This is because PHP5 has rewritten the
The date time function is the core component of PHP. These functions can be used without installation. The specific use of the date function is described in detail below:
PHP Date () functionThe PHP date () function formats the timestamp as a more readable
corresponding to the date and time in the current time zoneSimpleDateFormat format = new SimpleDateFormat ("yyyy-MM-dd HH: mm: ss"); // set the formatString dateString = "03:36:25"; // you can specify a date String.UnixTimeGMT = unixTime = format. format (date); // obtain t
date and time in the current time zone. Simpledateformat format = New Simpledateformat ("yyyy-mm-dd hh: mm: SS "); // Set format String datestring = "03:36:25 "; // Set a date string with the specified format Unixtimegmt = unixtime = format. Format (date ); // Obta
%h:%m ', Time.localtime ())' 2017-02-04 14:19 'Struct_time format to timestamp format time
>> Time.mktime (Time.localtime ())1486189282.0
Time format Conversion
Time stamp format time and string format time
This article mainly introduces the time function date in PHP and the relevant knowledge of time calculation, which has a good reference value. Let's take a look at the little series.
have been in the project need to use to today, yesterday, this week, this month, this quarter, this year, last month, the previous quarter and so on
year leap years: 0
echo Date (' L ');
Today is: Tuesday
echo Date (' D ');
Today is: Tue
Capital L indicates whether a leap year is a Boolean value that returns 1 for true or 0;
Lowercase L means the day is the week of the English full write (Tuesday);
Instead, use uppercase D to denote the 3-character abbreviation for the Day of the Week (Tue).
echo Date ('
year leap years: 0
echo Date (' L ');
Today is: Tuesday
echo Date (' D ');
Today is: Tue
Capital L indicates whether a leap year is a Boolean value that returns 1 for true or 0;
Lowercase L means the day is the week of the English full write (Tuesday);
Instead, use uppercase D to denote the 3-character abbreviation for the Day of the Week (Tue).
echo Date ('
leap year is a Boolean value that returns 1 for true or 0;Lowercase L means the day is the week of the English full write (Tuesday);Instead, use uppercase D to denote the 3-character abbreviation for the Day of the Week (Tue).echo Date (' W ');Today's Week: 2echo Date (' W ');This week is the No. 06 week of the year.The lowercase w represents the day of the week, the number form representsCapital W indicat
dateStr="2013/5/12 20:10:20";var date=new Date(dateStr);console.log(date.getTime());
You can use the getTime () function to obtain the timestamp of the specified time and date object.
Next we will introduce the getTime () method of the Date object in javascript.
GetTime (
still has the ISO calendar system, and unlike its predecessors, classes in the Java.time package are immutable and thread-safe. The new time and date APIs are located in the Java.time package, and below are some of the key classes inside:
instant--It represents a time stamp.
The localdate--does not cont
Programmers who write Php+mysql know there is a time difference, UNIX timestamp and format date are two time representations we often deal with, Unix timestamp storage, processing convenient, but not intuitive, format date intuitive, but not as easy to deal with the Unix time
Checkdate:
Verify the correctness of the date.
Date:
Format the time of the server.
Strftime:
The time of the server is formatted locally.
GETDATE:
Get time and date information.
Dayname returns a string of both upper and lower cases. For the day part of the parameter, the name of the day (for example, Friday) is expressed by week ).Dayofweek returns the day of the week in the parameter, expressed by an integer ranging from 1 to 7, where 1 represents Sunday.Dayofweek_iso returns the day of the week in the parameter, expressed by an integer ranging from 1 to 7, where 1 represents Monday.Dayofyear returns the day of the year in the parameter, expressed by an integer rangin
Dayname returns a string of both upper and lower cases. For the day part of the parameter, the name of the day (for example, Friday) is expressed by week ).
Dayofweek returns the day of the week in the parameter, expressed by an integer ranging from 1 to 7, where 1 represents Sunday.
Dayofweek_iso returns the day of the week in the parameter, expressed by an integer ranging from 1 to 7, where 1 represents Monday.
Dayofyear returns the day of the year in the parameter, expressed by an integer ran
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.