MSSQL Server Common date functions
Your program may need to determine the first or last day of one months. Most of you probably know how to split dates (year, month, day, etc.), and then just use the split year, month, day, etc in several functions to calculate the date you need! In this article, I'll show you how to
For details about the date () date and time functions in php, refer. 1, year-month-day
Echo date ('Y-m-J ');
2007-02-6
Echo date ('Y-n-J ');
07-2-6
Uppercase Y indicates four digits of the year, while lowercase y indicates two digits of the year;
Lowercase m indicates the
MySQL Date and Time FunctionsMySQL Date and Time Functions
DAYOFWEEK (date)The return date is the day of the week (1 = Sunday, 2 = Monday ,...... 7 = Saturday, ODBC Standard)Mysql> select DAYOFWEEK ('2017-02-03 ');-> 3WEEKDAY (date
server| function//in PHP processing date is very inconvenient, such as the two date difference between the month? What should we do?
FileName: date.inc.php3
Before you use these two functions, you must first convert the date or datetime to the timestamp type.
Such as:
$today =mktime (0,0,0,
Common date-time functions in JS developmentString to date type, Date.prototype.isleapyear judge leap yearDate.prototype.format Date formatDate.prototype.dateadd Date CalculationDate.prototype.datediff Comparison Date DifferenceDa
You can check it later.
I,MySQLGet current date and time
Now (): Obtain the current date + time (date + time) function:
Mysql> select now ();
+ --------------------- +
| Now () |
+ --------------------- +
| 10:26:23 |
+ --------------------- +
1 row in SET (0.00 Sec)
The same functions include cu
minute of time, ranging from 0 to 59.Mysql> Select MINUTE (' 98-02-03 10:05:03 ');5SECOND (Time)The number of seconds to return time, ranging from 0 to 59.Mysql> Select SECOND (' 10:05:03 ');3Period_add (P,n)Add n months to the stage p (in format Yymm or yyyymm). Returns a value in the format yyyymm. Note that the stage parameter p is not a date value.Mysql> Select Period_add (9801,2);199803Period_diff (P1,P2)Returns the number of months between the
Basic Functions
Date () Get dates, format: 2004-2-28
Time () to get the date, format: 22:24:59
Now () Get date and time format: 2005-5-2 22:37:30
How to use:
D=date ()
Get Year: Years (d)
Get month: month (d)
Get Days: Day (d)
Get Day of the week: weekday (d)
T=time ()
stage parameter p is not a date value.Mysql> Select Period_add (9801,2);199803Period_diff (P1,P2)Returns the number of months between the period P1 and P2, P1 and P2 should be in the format yymm or yyyymm. Note that the time parameters P1 and P2 are not date values.Mysql> Select Period_diff (9802,199703);11Date_add (Date,interval expr type)Date_sub (
PHP two commonly used date related functions date and strtotime, I believe we must not be unfamiliar. But we usually use all just basic function, what time stamp change date format, date format change timestamp.In fact, these two functio
It is very inconvenient to process dates in PHP, for example, to find the month of the difference between two dates? What should I do? File name: date. inc. php3 before using these two functions, you must first convert the date or date to the timestamp type. For example: $ todaymktime (, 0,
It is very inconvenient to process dates in PHP, for example, to find the month of the difference between two dates? What should I do? File name: date. inc. php3 before using these two functions, you must first convert the date or date to the timestamp type. For example: $ todaymktime (0, 0, 0,
This article describes how to display the current time and date in the title bar of a web page in JavaScript. It involves JavaScript date and time functions and related tips on page title bar operations. It has some reference value, for more information about how to use
Runtime ConfigurationThe behavior of the Date/time function is affected by the settings in php.ini:
name
Description
default
PHP version
Date.timezone
Specify the default time zone (all Date/time functions use this option)
""
PHP 5.1
Date.default_latitude
Specify Default latitude (Da
[PHP] Return to the basics (date and strtotime functions), datestrtotime
Date (): format a local time or date. The current time is 15:19:49, January 1, May 13, 2016.
Use the date () function to output the day of the current month. Parameter: String type d
Example: echo
File name: date. inc. php3 before using these two functions, you must first convert the date or date to the timestamp type. For example: $ todaymktime (0, 0, 0, date (m), date (d), date
// It is inconvenient to process dates in PHP, for example, to find the month with a different date? What should I do? // File name: date. inc. php3 // before applying the two functions, convert the date or date to the timestamp type. // For example: // $ today = // it is in
appropriate functions (if applicable) separately) year, month, day, hour, minute, second, And microsecond: year (current timestamp) month (current timestamp) day (current timestamp) hour (current timestamp) minute (current timestamp) second (current timestamp) microsecond (current timestamp)
Because there are no better terms, you can also use English for date and time calculation:Cur
PHP simulates the two date processing functions of SQLServer and reads the two date processing functions of PHP to simulate SQLServer. // It is very inconvenient to process the date in PHP, such as finding the month of the difference between the two dates? What should I do?
Whether they are accustomed to displaying the current server time or logging the next instance of a database entry, PHP's date and time functions are an important part of their toolkit for any network developer.
But any tool needs a person to dominate to play the advantage.
That's why I wrote this article. The following table (table A) lists some of the most important
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.