1. function getdays($day){
  2. $lastday=date('Y-m-d',strtotime("$day Sunday"));
  3. $firstday=date('Y-m-d',strtotime("$lastday -6 days"));
  4. return array($firstday,$lastday);
  5. }
  6. print_r(getdays('2012-06-2'));

PHP获得指定日期所在星期的第一天和最后一天的更多相关文章

  1. MSSQL 获取指定日期所在星期的第一天和最后一天日期 获取指定日期坐在月的第一天和最后一天

    ufn_GetWeekFirstAndEndDay    获取指定日期所在星期的第一天和最后一天日期 ALTER FUNCTION [dbo].[ufn_GetWeekFirstAndEndDay]( ...

  2. PHP获得指定日期所在月的第一天和最后一天

    function getdays($day){ $firstday = date('Y-m-01',strtotime($day)); $lastday = date('Y-m-d',strtotim ...

  3. php获取指定日期所在星期的开始时间与结束时间

    function getWeekRange($date){    $ret=array();    $timestamp=strtotime($date);    $w=strftime('%u',$ ...

  4. c# 获取某日期所在周的第一天和最后一天

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WyfC ...

  5. c# 获取某日期所在周的第一天和最后一天(转)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WyfC ...

  6. java Calendar Date 获取指定日期所在月或年的第一天和最后一天

    一.获取传入日期所在月的第一天 public static Date getFirstDayDateOfMonth(final Date date) { final Calendar cal = Ca ...

  7. PHP获取指定日期是星期几的实现方法

    这篇文章主要介绍了PHP获取指定日期是星期几的实现方法,涉及php针对日期的读取.判断与字符串.数组相关运算操作技巧,需要的朋友可以参考下 本文实例讲述了PHP获取指定日期是星期几的实现方法.分享给大 ...

  8. PHP:获取指定日期所在月的开始日期与结束日期

    /** * 获取指定日期所在月的开始日期与结束日期 * @param string $date * @param boolean 为true返回开始日期,否则返回结束日期 * @return arra ...

  9. R语言两种方式求指定日期所在月的天数

                 R语言两种方式求指定日期所在月的天数 days_monthday<-function(date){ m<-format(date,format="%m& ...

随机推荐

  1. js进阶正则表达式9量词2(^和&作用:/^HTML5$/g匹配不到aHTML5b中的HTML5,不然是可以匹配到的)(/\d+(?=cm)/g)((?!cm))

    js进阶正则表达式9量词2(^和&作用:/^HTML5$/g匹配不到aHTML5b中的HTML5,不然是可以匹配到的)(/\d+(?=cm)/g)((?!cm)) 一.总结 ^和&作用 ...

  2. [tmux] Customize tmux with tmux.conf

    You can modify tmux's behavior with your tmux configuration file, .tmux.conf. You can use your tmux ...

  3. 【t062】最厉害的机器人

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] [背景] Wind设计了很多机器人.但是它们都认为自己是最强的,于是,一场比赛开始了~ [问题描述] ...

  4. 如何将服务器传来的字符串转成HTML显示在前端页面

    从后台返回的字符串是一段HTML源代码,如果不做处理,直接插入前端页面中 ,会显示为字符: 现需求为:将后台返回的字符串str以HTML显示在div中: <div id='container'& ...

  5. uva 1519 - Dictionary Size(字典树)

    题目链接:uva 1519 - Dictionary Size 题目大意:给出n个字符串组成的字典.如今要加入新的单词,从已有单词中选出非空前缀和非空后缀,组成新单词. 问说能组成多少个单词. 解题思 ...

  6. while 常见程序逻辑

    1. 查找 List L; Position P = L; while (P && P->Element != Key) { P = P->Next; } return P ...

  7. js页面加载函数

    在未加载完文档,使用jquery选择器选择元素后,如果立即绑定事件进行调用,会引起js的报错(can not read property of undefined),导致事件不能绑定成功. alert ...

  8. Filter,Listener(转)

    一.Filter的功能filter功能,它使用户可以改变一个 request和修改一个response. Filter 不是一个servlet,它不能产生一个response,它能够在一个reques ...

  9. Display controller

    Field of the Invention The present invention relates to a display controller. Background to the inve ...

  10. 【BZOJ 1026】 [SCOI2009]windy数

    [题目链接]:http://www.lydsy.com/JudgeOnline/problem.php?id=1026 [题意] [题解] 数位Dp 设f[i][j]表示长度为i,第一位(也就是最高位 ...