Concept | advanced
Java Advanced Date Concepts
If your Java program displays time and date to users in different time zones or different countries, you need to understand some of the more advanced aspects of the Java date
Common date functions
SQL Server time and date function detailed, SQL Server, time, date,
1. Current system date, time
Select GETDATE ()
2. DateAdd returns a new datetime value on the basis of adding a period of time to the specified date
For
PHP-time (), date (), mktime () date and time function library. Checkdate verifies the correctness of the date. Syntax: intcheckdate (intmonth, intday, intyear); return value: integer function type: time and date content description if the date is
Checkdate: Verify that the date is correct.
Date: format the server time.
Strftime: format the server time locally.
Getdate: Get the time and date information.
Gettimeofday: Get the current time.
Gmdate: Get the current time difference from
Introduction
On the computerProgramIt is difficult to accurately process the date in. Not only are there obvious (English: January, French: Janvier, German: Januar, etc.) Internationalization requirements, different date systems must also be
The function of the date command is to display and set the system date and time.
The general format for this command is: date [options] Displays the time format (beginning with +, followed by formatting)
Date set time format
The meanings of the
DateCommandThe function of the date command is to display and set the system date and time.The general format for this command is: date [options] Displays the time format (beginning with +, followed by formatting)Date set time formatThe meanings of
PHP: time (), date (), mktime () date and time function libraries are often forgotten. here, you can add them to your favorites for convenience: checkdate: to verify the correctness of the date.
Date: format the server time.
Strftime: format the
SQL statement gets a specific date
1. The first day of one months
Select DATEADD (mm, DATEDIFF (Mm,0,getdate ()), 0)
2. Monday of this week
Select DATEADD (wk, DATEDIFF (Wk,0,getdate ()), 0)
3. The first day of the year
Select DATEADD (yy,
SQL Server Date and Time Processing set
When the convert date conversion format is 20 or 120, the resulting string does not contain milliseconds.For example, select convert (varchar (23), getdate (), 120 or 20)21:46:43
When the date conversion
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.