I am trying to output Monday of the current week i.e. if Monday is the
8th I want to display 'Monday 8th' for any date between Monday 8-14th.
I would appreciate any help, the code below is heading in the right
direction but doesn't quite give me the results I am looking for.
$givenday = mktime(0,0,0,10 ,08,2007);
$Monday = strtotime("Mond ay this week",$givenday );
echo date("j M Y H:i:s", $Monday);
Cheers,
Chris 5 13718
In our last episode,
<11************ **********@g4g2 000hsf.googlegr oups.com>,
the lovely and talented Chris
broadcast on comp.lang.php:
I am trying to output Monday of the current week i.e. if Monday is the
8th I want to display 'Monday 8th' for any date between Monday 8-14th.
I would appreciate any help, the code below is heading in the right
direction but doesn't quite give me the results I am looking for.
$givenday = mktime(0,0,0,10 ,08,2007);
$Monday = strtotime("Mond ay this week",$givenday );
echo date("j M Y H:i:s", $Monday);
Cheers,
Chris
This seems to work for me.
php -r "echo date('j M Y H:i:s',strtotim e('last Monday', \
strtotime('Sund ay')));"
You want the Monday previous to next Sunday.
--
Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner>
Countdown: 466 days to go.
What do you do when you're debranded?
<comp.lang.ph p>
<Chris>
<Thu, 11 Oct 2007 15:05:04 -0700>
<11************ **********@g4g2 000hsf.googlegr oups.com>
I am trying to output Monday of the current week i.e. if Monday is the
8th I want to display 'Monday 8th' for any date between Monday 8-14th.
I would appreciate any help, the code below is heading in the right
direction but doesn't quite give me the results I am looking for.
$givenday = mktime(0,0,0,10 ,08,2007);
$Monday = strtotime("Mond ay this week",$givenday );
echo date("j M Y H:i:s", $Monday);
<?php
$less=0;
$loopy=1;
while ($loopy<8)
{
$temp1=date("l dS",time()-$less);
$temp2=date("l dS M Y H:i:s",time()-$less);
$wsx=" $temp1 "; $qaz=strpos($ws x,"Monday"); if ($qaz==true) {break;}
$less=$less+864 00;
$loopy=$loopy+1 ;
}
print "temp1 = $temp1 <br>";
print "temp2 = $temp2 <br>";
?>
-- www.vhit.co.uk www.jpgimage.co.uk www.phpwhois.co.uk www.cannabiswindow.co.uk
On Oct 11, 11:29 pm, Lars Eighner <use...@larseig hner.comwrote:
In our last episode,
<1192140304.180 826.282...@g4g2 000hsf.googlegr oups.com>,
the lovely and talented Chris
broadcast on comp.lang.php:
I am trying to output Monday of the current week i.e. if Monday is the
8th I want to display 'Monday 8th' for any date between Monday 8-14th.
I would appreciate any help, the code below is heading in the right
direction but doesn't quite give me the results I am looking for.
$givenday = mktime(0,0,0,10 ,08,2007);
$Monday = strtotime("Mond ay this week",$givenday );
echo date("j M Y H:i:s", $Monday);
Cheers,
Chris
This seems to work for me.
php -r "echo date('j M Y H:i:s',strtotim e('last Monday', \
strtotime('Sund ay')));"
You want the Monday previous to next Sunday.
--
Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner>
Countdown: 466 days to go.
What do you do when you're debranded?
Cheers Lars!
I wanted a link to show this monday, then the next etc. Your code
helped, will continue to build on it.
$monday = date('j M Y', strtotime('last Monday',
strtotime('Sund ay')));
$unixtime_monda y = strtotime($mond ay);
$next_monday = date('j M Y', strtotime('+1 week', $unixtime_monda y));
Chris
On Sun, 14 Oct 2007 21:24:24 +0200, Chris <ma*********@go oglemail.com
wrote:
On Oct 11, 11:29 pm, Lars Eighner <use...@larseig hner.comwrote:
>In our last episode, <1192140304.18 0826.282...@g4g 2000hsf.googleg roups.com>, the lovely and talented Chris broadcast on comp.lang.php:
I am trying to output Monday of the current week i.e. if Monday is the
8th I want to display 'Monday 8th' for any date between Monday 8-14th.
I would appreciate any help, the code below is heading in the right
direction but doesn't quite give me the results I am looking for.
$givenday = mktime(0,0,0,10 ,08,2007);
$Monday = strtotime("Mond ay this week",$givenday );
echo date("j M Y H:i:s", $Monday);
Cheers,
Chris
This seems to work for me.
php -r "echo date('j M Y H:i:s',strtotim e('last Monday', \ strtotime('Sun day')));"
You want the Monday previous to next Sunday.
-- Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner> Countdown: 466 days to go. What do you do when you're debranded?
Cheers Lars!
I wanted a link to show this monday, then the next etc. Your code
helped, will continue to build on it.
$monday = date('j M Y', strtotime('last Monday',
strtotime('Sund ay')));
$unixtime_monda y = strtotime($mond ay);
Euhm, what am I missing?
$monday = date('j M Y', strtotime('last Monday',strtoti me('Sunday')));
$unixtime_monda y = strtotime($mond ay);
Would be equal to:
$unixtime_monda y = strtotime('last Monday',strtoti me('Sunday'));
is it not?
--
Rik Wasmus
In our last episode, <11************ **********@e9g2 000prf.googlegr oups.com>,
the lovely and talented Chris broadcast on comp.lang.php:
On Oct 11, 11:29 pm, Lars Eighner <use...@larseig hner.comwrote:
>In our last episode, <1192140304.18 0826.282...@g4g 2000hsf.googleg roups.com>, the lovely and talented Chris broadcast on comp.lang.php:
I am trying to output Monday of the current week i.e. if Monday is the
8th I want to display 'Monday 8th' for any date between Monday 8-14th.
I would appreciate any help, the code below is heading in the right
direction but doesn't quite give me the results I am looking for.
$givenday = mktime(0,0,0,10 ,08,2007);
$Monday = strtotime("Mond ay this week",$givenday );
echo date("j M Y H:i:s", $Monday);
Cheers,
Chris
This seems to work for me.
php -r "echo date('j M Y H:i:s',strtotim e('last Monday', \ strtotime('Sun day')));"
You want the Monday previous to next Sunday.
Cheers Lars!
I wanted a link to show this monday, then the next etc. Your code
helped, will continue to build on it.
$monday = date('j M Y', strtotime('last Monday',
strtotime('Sund ay')));
$unixtime_monda y = strtotime($mond ay);
$next_monday = date('j M Y', strtotime('+1 week', $unixtime_monda y));
Yes, but php strtotime already knows 'next Monday':
Sun Oct 14 15:33:54 bash3.2:ttyp0:l ars
debranded~$php -r "echo date('j M Y',strtotime('n ext Monday'));"
15 Oct 2007
(Yes, it is broken if your php is older than 4.4.0)
The problem part of your original problem was that strtotime doesn't know
something like "Monday of this week". The difficulty of implementing that
in the strtotime function would be that people would have different
understandings of what they mean by 'this week.' For example, your problem
involves the work week (of which Sunday is the last day). Most Western
calendars use a week that ends on Saturday. You might well consider Jan. 1
to be the first day of the first week.
And it has been mentioned that:
$monday = date('j M Y', strtotime('last Monday',
strtotime('Sund ay')));
$unixtime_monda y = strtotime($mond ay);
is the same as
$unixtime_monda y = strtotime('last Monday', strtotime('Sund ay')));
There is no point in going string to time and back.
So even if you have old php (or want to be backwards compatible with
broken versions)
$next_monday = date('j M Y', strtotime('+1 week',
strtotime('last Monday', strtotime('Sund ay'))));
--
Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner>
Countdown: 463 days to go.
What do you do when you're debranded? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: deko |
last post by:
This runs, but does not narrow to current week.
suggestions appreciated!
SELECT lngEid, dtmApptDate, Subject, Appt_ID
FROM qry002
WHERE (dtmApptDate BETWEEN
DateAdd("d",-weekday()+2,) And DateAdd("d", 6,
DateAdd("d", -weekday()+2,)))
|
by: GregginOttawa |
last post by:
I've been Googling and reading for 5 days now trying to figure out how
to write a query that selects records with dates in the current week
(Sun to Sat). You'd think it would be remarkably simple (maybe it is),
but I can't find a simple answer.
If anyone could provide a relatively simple method, I would very much
appreciate it.
Thanks -
|
by: Tina |
last post by:
My employer tracks productivity/performance of clinicians (how much
they
bill) each week, its averages for the month, and the 6 months.
These averages are compared to their expected productivity.
However, the expectation changes - it may be 60% for a while, then
change to
50%. Initially, I was averaging the expectation, along with the
productivity, but what I'm being asked is to look at the average
productivity/performance compared to...
|
by: kennyscripts |
last post by:
Hi Friends......
How to get the current month and current week in vb.net 2003
Can view the month textbox details and can only enter the week detail.
How to get? Anybody knows give the answer.
Thanks in Advance
|
by: Aljosa Mohorovic |
last post by:
i use this to find out current week and total number of weeks for
current year:
now = datetime.now()
weeks_in_year = int(date(now.year, 12, 31).strftime("%W"))
current_week = int(date(now.year, now.month, now.day).strftime("%W"))
is this the best way or is there a better way?
Aljosa Mohorovic
| |
by: anu |
last post by:
Please let me know how I can get the starting date of the current week
in PHP.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |