These two tips, do not write do not know, a write scare!
Are seemingly simple, actually do up on the Meng, have to think carefully, can write right!
All have the date operation of the program should be careful Oh!
Let's say the second one:
2.
PHP gets days of the week and dates of Monday and next Monday for this week
$today =date ("y-m-d");
echo $today;//You can get the date today. Output 2014-9-29
Define an array first.
$rows =array ("Day", "one", "two", "three", "four", "five", "
Snowdust)
Replied to the score from 09:35:3430
If Sunday is the first day of a week:Private void button#click (Object sender, system. eventargs E){Datetime dt = datetime. Now. adddays (-(INT) datetime. Now. dayofweek );For (INT I = 0; I {This.
select extract (ISOYEAR from fromdate_) as year_, --the year in which the week was made extract (WEEK FROM fromdate_) as week_, --the year in which the week was made To_char (fromDate _ , ' YYYYMMDD ')
js| Date Author: builder.com
When developing applications about calendars, the number of irregular monthly dates, days of the week, and weekend calculations has always been a no-brainer. As a result, date and time programming often makes novice
Main ideas:
For any 2 dates, such as: Date_start=2006-10-1, date_end=2006-10-14, first calculate the interval between the dates (days), and then get their next Monday date for Date_start and Date_end respectively. So you can get a new full date
When developing applications about calendars, the number of irregular monthly dates, days of the week, and weekend calculations has always been a no-brainer. As a result, date and time programming often makes novice programmers cringe. This article
DATEADD functionDescription: Returns the date on which the specified time interval has been added.Syntax DateAdd (interval, number, date)Interval: Must be selected. A string expression that represents the time interval to add. See the Settings
Javascript compares the days between two dates and the javascript days$ (Function (){Var starttime = transdate ("15:53:00 ");Var endtime = transdate ("15:53:00 ");Var now = "'" + new Date (). getTime () + "'";Var nowtime = now. substr (1, 10 );If
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.