: This article mainly introduces PHP's collection of yesterday's timestamp, current time information array, last week and last week's year, last month and last month's year, if you are interested in the PHP Tutorial, refer.
/*** Get the current time
First, you need to understand an international standard: ISO8601, which is the International Organization for Standardization (ISO) notation for defining dates and times, which is the representation of data storage and interchange, information
/** * Gets the current time information array * @params void * @return array */function get_current_time_array () {$date = Strtotime (Date (' y-m-d ')); Date time stamp $week = (int) date (' W '); The first week of the Year $
Obtain the year, month, and day of the current week from the year, month, and day of the current week from the year, month, and day of the current day.
PHP code
// Obtain the end date of the latest week corresponding to the year, month, and Day.
Java gets the implementation idea and Code on the first day of a week in a year, and the java ideaDirectly Add codeCopy codeThe Code is as follows:Import java. util. Calendar;Import java. util. Date;Import org. apache. commons. logging. Log;Import
PHP obtains the year, month, and day of the current week based on the year, month, and day of the current day.
// Obtain the end date of the latest week corresponding to the year, month, and day.
Function GetClearWeek (){
Select GETDATE() as 'Current Date', Datename( Year,GetDate()) as 'years', Datename(Month,GetDate()) as 'Month', Datename( Day,GetDate()) as 'Day', Datename(DW,GetDate()) as 'Week', Datename(Week,GetDate()) as 'Week number',
1 ORACLE mid-week related knowledge description 1.1 Date formatting functions To_char (X [,FORMAT]) : Press X toFORMATThe format is converted into a string. X is a date,FORMATis a format string that specifies the format in which X is
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.