Date Of The Week
Can anyone help me? I am trying to work out the timestamp for the first DATE (not day) of the current week and last date of the current week. Any ideas?
View Complete Forum Thread with Replies
Related Forum Messages:
Display For The Week Of (fridays Date Of The Week).
I have a report that people can access online and it generates data for a given week until friday. In the title and on the report, I want to display For The Week Of (fridays date of the week). Instead of writing a huge if - then statement array - is it possible for to simply have an expression that figures out what day it is and then tells me Fridays date - has anyone ever done anything like this.
View Replies !
Getting Day Of The Week From A Date
I tried searching the old postings, but to no avail. I am trying to figure out a way to get the day of the week from a date. Basically, I have a date in the format of 05/02/2003 (but I can change that format easily) and I need to have my program figure out which day of the week that was. All of the dates that I have will have already passed.
View Replies !
Date To Week # Fct
I'm searching a PHP function that would translate a date in the following format yyyymmdd to the week number in the year... ex : 20040128 => 5 i.e. jan 28th 2004 gives week nb 5 in 2004.
View Replies !
Week Before Date
Im looking to get the date 7 days ago. I know how to do 7 days ahead: $timeStamp = strtotime($oLastBatchDate->Last); $timeStamp += 24 * 60 * 60 * 7; $NextBatchDate = date("Y-m-d H:i:s", $timeStamp); However, does anyone know how to do 7 days back?
View Replies !
Date And Week
I am looking for a way to determine the week of the year if i have a date.i know that date("W"); give me the week Number but not sure how to determine the week based on the date.
View Replies !
Week To Date.
how i can make a week number to a date string. Ex. week 1 ---> 1 Jan. till 7 jan. Date format is not important.
View Replies !
Date Out Of Week Number?
I would need to get a date out of a week number, for example for week 52 the first date, 25/12. In my system the user inputs a week number, and then I would like to display a popup list of all seven dates for that week, for her to choose from. Is there a handy function to do this, or can you think of any way to achieve this?
View Replies !
How To Calculate The Day Of The Week By A Given Date.
I'm currently working on a (simple) calendar system which allows registered users to add an event to the calendar. The table EVENT stores info about the author, date and description of the event. I then managed to output a list in which only events of this year are showed and are grouped together by months. And now I only need one more thing to complete the script. I want to output for every event on which day of the week it occurs (monday - sunday). I've looked around for tutorials but haven't found a basic one.
View Replies !
Date Function For Week Before
Im looking to get the date of a week before a certain date For example: $iLastDate = date("Y-m-d H:i:s "); $timeStamp = strtotime($iLastDate); $timeStamp + = 24 * 60 * 60 * 7; $NextBatchDate = date("Y-m-d H:i:s", $timeStamp); This is for a week ahead, how do I do a week before?
View Replies !
Work Out Day Of Week From Given Date
I'm using a date picker to choose a date. the format of the date entered into the textbox is yy/mm/dd From this how can I work out the day of the week from the entered date? I need this as the first day has to be a sat, and if it isnt my form will tell the user to choose a saturday. Is there a simple way of doing this?
View Replies !
Week Numbers To Date
I like to know how i can make a week number to a date string. Example week 1 ---> 1 Jan. till 7 jan. Date format is not important. I have a calendar that has week numbers on it (week 1 till 52) But the customer wants it to have dates also on the form (mouse over or something. I don' want to adjust the Whole site and DB.
View Replies !
Date Manipulation - Find The Day Of Week
I have to do an events calender for a church. The events display will be limited to that week. If someone went in today Wed 24th I want to display 21st to 27th. I dont want any code samples, just the functions that find the day of week and a function that can (in this case) subtract 3 days to get sunday and add 7 for saterday. I can do the rest.
View Replies !
Getting Day Of Week From User Defined Date?
is there a way to do this? e.g. i have three drop down boxes in html asking the user for day (1-31), month, year (2007 or 2008) i then have: // get user input $start_day = $_POST["start_day"]; $start_month = $_POST["start_month"]; $start_year = $_POST["start_year"]; //echo $start_year; $the_date = $start_day . "/" . $start_month . "/" . $start_year; echo $the_date; say then i get an output as 13/10/2007 if the user enters that date, is there a way to get what day of the week this is?
View Replies !
Find Out What Day Of The Week A Certain Date Falls On
I would like to find out what day of the week a certain date falls on. i know the command for doing it for today. $today = date("w"); anyone know how to do it for a variable date? like say 2007-11-25 I can't seem to find that. I can write some whacked out function to it. But i was hoping for an easier way.
View Replies !
Code To Calculate Date Range In A Given Week
Well I'm facing a problem in calneder and want your help. I want to calculate the date that fall in a give week but am not able to get the method for doing so. Let me explain it with an example. Suppose i select teh 25th week of the present year(i.e 25th week of year 2006) then how can i calculate the days that fall in that week.
View Replies !
Using The Date Function To Find Last Week Start And End.
I need to find the start of last week (monday) and the end of last week (sunday) using the date function in a Y-m-d format. But it needs to work this out regardless of todays date. Finding a day in the past is not a problem if you know how many days to minus from the date function, but how can I work this to be not dependent on this fact?
View Replies !
MySQL: Going From Week Of The Year To Date Of The Monday
So I know how to get the week of the year from a date. What I want to know is if there is a way in MySQL to get the date of the Monday of a week specified by a week number. For example, I have a bunch of items in a database with dates. I know how to tell the database to get only the items that occur in, say, week 5 of the year, but how do I get the date of the Monday of that week? I found a way to do it in PHP but for performance reasons I wanted to know if it's possible inside the MySQL statement. Also, as an aside, is it possible to assign a value to a "variable" in a MySQL statement (e.g., select something AS somename) then use that as an argument later in the statement?
View Replies !
Date Stamp Based On Week Number
Have a bit of a odd-one here: I'm attempting to determine / return a date (ex: 10/28/2002) based off of these parameters: - year ( 2002) - week number (1-52) - day name (Saturday, Sunday, etc.) I'm wondering which date funtions I need to cludge together to get this to work, any suggestions? example: $which_day = foo("2002", "3", "Sunday"); would return the date stamp for the 3rd Week' of 2002's Sunday. In the case of the example should return: "01/13/2002"
View Replies !
What Day In The Month Is The First Day Of A Week (based On Date In Querystring)
I really need to work out what day of the month the first day of the week is based on a date I pass through a query string. At the moment I am able to work out what the first date of this week is using: $day_in_month = date('d', strtotime('last monday')); However, the documentation for strtotime is a bit weak and i'm not really understanding it. If I pass something like : 2006-12-24 00:00:00 through the query string, how can I find out what day in the month the first day of the week is (which should be December 18th)?.
View Replies !
Day Of Week ?
Is there a way I can obtain the day of week - If I have the day, month, year ? (not via the time function - But from a database....) Im looking through the calendar and date functions -But can't locate anything suitable...
View Replies !
Day Of The Week?
is there a way to get the day of the week in php? i want to get the correct values monday, tuesday, wdenesday, etc. for the actual day it is.
View Replies !
Getting Day Of Week Out Of Datestamp
I currently have a datestamp in the format yyyymmdd. I want to pull the day of the week (Monday, Tuesday, etc...) out of that datestamp at any given time. Currently my code looks like this: $datearray = getdate($firstdatestamp); echo $datearray["weekday"]; When $firstdatestamp = 20000501 (or the first of May, 2000) the weekday returned is Thursday when really it should be Monday! I tried: echo date("l", time()); and it gives me the right weekday but only for the current date. I need to pass this my datestamp and am not too sure how.
View Replies !
Getting SQL Rows For A Week
I have a database that uses two date fields for tracking information. The first field is for the addition of the record and the second is for the expiration. I have a small section that I want to list records that will expire in the current week (or for that matter in the next 7 or 14 days). What is the syntax that I would use to call mySQL with to get that info.
View Replies !
Week Of The Month
I need to determine the week of the month (1-5) so I can rotate menus for a cafeteria. Is the following, which I know prints the week rather than storing it, the simplest or easiest way to determine the week? PHP Code:
View Replies !
File Of The Week?
I wish to add an automated "file of the week" feature to a site for users to download. I was having a little trouble explaining this.... So I ended up making these few points on the functions of the script I'm aiming for: - The script finds the folder with the files for the current week. (If the download was a wallpaper, there would be files for different resolutions, and therefore more than one file.) - Links are then made to the files. - Every week, the links are updated for the new files for the current week. I was thinking along the lines of putting the weekly files into folders named after timestamps and going from there... Is that the way to go? And how would it be done? I can't quite figure this out.
View Replies !
Printing Every Week
im trying to print a list of every Friday since a date defined. Let me try and explain. I want to define a date such as 2007-07-06 (which is a Friday) and then let php print each Friday since that date until today. For example, if the date defined was 2007-07-06 then it would print 2007-07-06 2007-07-13 2007-07-20 2007-07-27 2007-08-03 2007-09-14 But I want to also be able to format the date it outputs, so it might look like Friday 06 July 2007 Friday 13 July 2007 Friday 20 July 2007 and so on.
View Replies !
Day Of The Week Program
I am trying to write a program that will give me the day of the week without using the date function. I input the date and it's supposed to spit out the name of the day of the week. Here is what I have so far. I don't know quite what to do next. Code:
View Replies !
Get Dates Before From Last Week
<?php //today date is: 2006-04-10 08:18:24 //last week is: 2006-04-03 06:23:10 $lastWeek=date('Y-m-d H:i:s', strtotime('-1 week')); //How do I get any date before last week(2006-04-03 06:23:10) //This show all date start from last week (2006-04-03 06:23:10) up to today (2006-04-10 08:18:24) $result = mysql_query("SELECT * FROM $table WHERE dateCreate >= '$lastWeek' //I want the opposite of this, from before last week, not from last week up to today. ?> How can fixed the above code to get all dates in the database from before last week? Any idea?
View Replies !
Days Of Week
I'm attempting to display information for today, the next day and the day after (so only three days worth). The first day is hardcoded to say now. I want the next day and the day after to be the abbreviated day (ie. Tue, Wed and so on). The problem I have with the following code is that now and the next day are the same. Thus, I have now (which is Tue), the next day (which is ALSO Tues - wrong!) and the day after is Wed. Here's the include: $return['mydata'] = array(); for($i = 0; $i < 2; $i++) { $attr = explode('"', $this->tag('blm:mydata',$i)); if(count($attr) > 1) { $day = array(); $day['when'] = $attr[1]; $day['image'] = IMAGES.$this->translate($attr[11]).'.gif' array_push($return['mydata'], $day); } } return $return; And here's the front-end page: echo " ".$stuff['mydata'][0]['when']."<br/>
View Replies !
Select Last Week
Is there a 'proper' way to select items with a date belonging to the previous week? I have this - SELECT n from table where YEARweek(a datestamp) = YEARweek(CURRENT_DATE - INTERVAL 7 DAY) && year(datestamp)=year(current_date) ... I think the flaw with that will come during the first week of January? Is there a better way?
View Replies !
Days Of Week In App
recommend for a best approach to populating a Days-of-the-Week table in an event-scheduler app? in my particular case, each day of the week relates to a daily drink-special for a bar. i'm trying to figure out my order of dependencies. here's a snapshot of my tables if i am going to add an event,i have to have it on a day of the week. that day of the week needs to have it's specials populated in order for it to exist in the Table. so, how should i go about "forcing" the Event Scheduler App User to first populate the Days-of-Week table so that when she adds data for an event, the dayys of the week will be available to input into the Event table?
View Replies !
Year Week
i´ve two variables the year and the week (2003 and 5) that means the 5th week of the year 2003. now i need the start- and enddate of the 5th week of year 2003.
View Replies !
Day Of Week (dates): How To?
I'm building a website and in the database i store all information. Visitors can add events to the database, with the date the event takes play. Now, when in the database it says : 2006-01-01 i want it to show : monday january the first 2006 (something like that)my question is : how can i see wich day of the week it is, depending on the day specification in the date from the db AND (optionally i don't know how it will be coded) how can i change the day 'wednesday' to 'woensdag' wich is the same day but in my language.
View Replies !
Finding The Day Of The Week
I know i can find the day of the week for today by doing: $day_of_week = date("D",mktime()); But what if the date I want to find is not todays date but in a variable say current_date?
View Replies !
Getting Results For This Week
I have a table with a date field and I need to get the results for the next week. Basicaly it's checking estimated completion dates and getting the results for jobs that are due within the next week. Table looks like this JobID-->Primary EstimatedCompletionDate-->Date Year Make Model etc... I need to get a list that shows all estimated completion dates between today and 7 days from now. I know how to check for jobs due today, but it's the 7 days from now that is throwing me off, especialy if the month changes.
View Replies !
Week Calendar
how to to build a events week calendar? This calendar should only display all the week of the selected year!!
View Replies !
Recurring Day For Every Week
I need a function which gives me the list of dates for certain weeks (date for every monday for 6weeks) I am not aware of built in functions of PHP.... any easier way to do it...? Code:
View Replies !
Week Query
I'm trying to write a myphp query which will show me same-day results for today's day of the week. therefor show Today and all previous tuesdays. I can get each order's day of week by using "DATE_FORMAT( b.statusdate, '%a')", but what is the syntax for making this show where equal to today's day of the week.
View Replies !
Datetime Within Past Week
I have a series of records in a database. When each record is stored, the datetime is logged: $date = date("Y-m-d H:i:s"); Prior to adding a new record to the database, I want to run a query to retrieve all of the records uploaded in the last 7 days. I thought it would be easiest to: Pseudo Code: $newDate = $date - 7 days; select * from TABLE where DATE $newDate; Problem is I can't figure out how to subtract 7 days from $date and convert that value to a valid datetime object.
View Replies !
Current Week Number
how I can split the month out into 5 weeks... then to have the week number printed and when the current week ends it will increment to the next week number. For example today is 3rd of July, therefore we are in week 1 of the month. Next week will be week two. I want it to go back to 1 at the start of the next month though.
View Replies !
Handling Week Number
I have been reviewing some calenders classes and have notice that if u uses us written class with displays week number it ll by wrong for eu. so to my question how do you handle week numeration depenting on country? is there any simple solutions for this?
View Replies !
Mysql WEEK() Function
In mysql WEEK() function it specify the number of week of a specific date. For example January 02, 2006 will return a value of 2. Now my problem is how could i be able to determine the range of that value in a week like a value of 2 will be equal to January 1, 2006 - January 7, 2006.
View Replies !
Month From Week Number?
Has anybody here ever made or seen a function which when passed year and week number in that year returns month ? actually what I want is all records from db starting from six months back till now and group them by weeks, and some weeks may have no record so they won't appear in resultset. But I have to display zero against these weeks. display has to be in form of Number of Records in Week # x of Month y e.g Number of Records in Week 2 x of Month Jan So my solution is to get records from db by this query: .. where abs(Week(Now()) - Week(RecTime)) <= 26 this works ok but I don't have any idea of which month and week of month was 6 months ago. So I decided to get week number and year of 6 months back and then write my function get month form this info.
View Replies !
Delete Records Since A Week
I've been trying to delete records since a week and i'm not able to do it. Before with this script, i was doing so many things at a time and i was confused.But, now, i just displaying the records from a table N trying to delete them.Would somebody pls guide me. I just wanna set the delete flag(i.e, i want to set the RBS_DELETE column to Y or something) when i check a check box to delete it. I've some 5 records displaying on my form and i want to check 3 of them and when i check them and hit submit, i want the RBS_DELETE column to have some value. PHP Code:
View Replies !
|