Jochen looks correct. His suggestion is mentioned in the strtotime docs.

Sometime due to Timezone, 
strtotime('last sunday') will return the last saturday.

To be sure that will never happen, use strtotime('last sunday 12:00:00')
  ----- Original Message ----- 
  From: Jochen Daum 
  To: [email protected] 
  Sent: Wednesday, September 29, 2010 10:49 AM
  Subject: Re: [phpug] Daylight Saving


    To fix this very particular problem, you could try (untested)
    strtotime("last Sunday 12:00") and it should/might return the EPOC for lunch
    time that day (assuming it's only the date that matters to you, and not the
    time).

    I'm guessing the problem your having is that strtotime("last Sunday") is 
    returning the EPOC for midnight which is being translated as Saturday 11pm.


  strtotime always made me feel uneasy. Feeling confirmed.



  Kind Regards,

  Jochen Daum

  P.S.: If you made it down here, why not connect with me on LinkedIn

  Chief Automation Officer
  Automatem Ltd

  Phone: 09 630 3425
  Mobile: 021 567 853
  Email: [email protected]
  Skype: jochendaum
  Website: www.automatem.co.nz
  http://twitter.com/automatem
  http://nz.linkedin.com/in/automatem
  http://www.xing.com/go/invite/3425509.181107
  http://www.aucklandbusinessnetworking.co.nz



  On Wed, Sep 29, 2010 at 10:47 AM, Nathan Kennedy 
<[email protected]> wrote:








    HTH.


    Thanks,
    Nathan.

    -----Original Message-----
    From: [email protected] [mailto:[email protected]] On Behalf
    Of Brendan Brink

    Sent: Wednesday, 29 September 2010 10:06 a.m.
    To: [email protected]

    Subject: Re: [phpug] Daylight Saving

    hi there,

    the date is echoing correctly currently to the right time and day

    the issue is when i use strtotime("last Sunday") it shows its a
    Saturday? (25th September) instead of Sunday 26th September

    this is so frustrating...

    any advice?


    On Wed, Sep 29, 2010 at 9:53 AM, Aaron Cooper <[email protected]>
    wrote:
    > Just to clarify, I mention 2008 and 2009 as I think 2008 was when the
    > government DST changes occurred.
    >
    > Easy test is to echo a date() and see what it says. If it's an hour out,
    you
    > need an update.
    >
    > http://www.electrictoolbox.com/correct-php-timezone/
    >
    >
    > ----- Original Message -----
    > From: Aaron Cooper
    > To: [email protected]
    > Sent: Wednesday, September 29, 2010 9:49 AM
    > Subject: Re: [phpug] Daylight Saving
    > As Rimu says, check the PHP timezonedb. Although I would have thought you
    > would lose an entire day out of it (except at 11pm).
    >
    > And that said, one would think the same server should have had this
    problem
    > in 2008 and 2009 if it is the sole culprit and the server was running
    sites
    > using any date function.
    >
    > ----- Original Message -----
    > From: Rimu Atkinson
    > To: [email protected]
    > Sent: Wednesday, September 29, 2010 9:35 AM
    > Subject: Re: [phpug] Daylight Saving
    > There is an internal database that php has of when different places have
    > daylight savings time, and yours is probably out of date. Look at the
    output
    > of phpinfo() to see the date of the time zone database.
    >
    > R
    >
    > On 29/09/10 09:26, Brendan Brink wrote:
    >
    > Hi there all,
    >
    > Had an issue on the weekend with some code showing the date Saturday
    > 25th instead of the Sunday 26th...and only thing I can put it down to
    > is a possible daylight saving conundrum...
    >
    > some of the code I had was this:
    > define("WEEKENDING",strtotime("next Sunday"));
    >
    >
    > wonder if anyone else had had a similar finding or perhaps can shed
    > some light on how daylight saving works with PHP...
    >
    >
    > --
    > Phone (04) 381 4827 or 021 823 129
    > Skype rimu123
    > Web http://rimu.geek.nz/
    >
    > --
    > NZ PHP Users Group: http://groups.google.com/group/nzphpug
    > To post, send email to [email protected]
    > To unsubscribe, send email to
    > [email protected]
    >
    > --
    > NZ PHP Users Group: http://groups.google.com/group/nzphpug
    > To post, send email to [email protected]
    > To unsubscribe, send email to
    > [email protected]
    >
    > --
    > NZ PHP Users Group: http://groups.google.com/group/nzphpug
    > To post, send email to [email protected]
    > To unsubscribe, send email to
    > [email protected]

    --
    Kind Regards,

    Brendan Brink

    SMS Marketing Consultant | Manager
    Sell2Cell Ltd.

    021 0246 1646 | [email protected] | www.sell2cell.co.nz




      We provide customized, cost-effective SMS & Web Solutions
      Need a website? Need to integrate text-messaging into your business
      or website? Contact us today for a free no-obligation quote!

      VISIT OUR ASSOCIATED WEBSITES:   textvouchers.com | textguru.co.nz

    WARNING This email contains information which is CONFIDENTIAL and may
    be subject to LEGAL PRIVILEGE. If you are not the intended recipient,
    you must not peruse, use, disseminate, distribute or copy the email or
    attachments. If you have received this in error, please notify us
    immediately by return email, facsimile, or telephone (call us
    collect).

    --
    NZ PHP Users Group: http://groups.google.com/group/nzphpug
    To post, send email to [email protected]
    To unsubscribe, send email to
    [email protected]


    --

    NZ PHP Users Group: http://groups.google.com/group/nzphpug
    To post, send email to [email protected]
    To unsubscribe, send email to
    [email protected]




  -- 
  NZ PHP Users Group: http://groups.google.com/group/nzphpug
  To post, send email to [email protected]
  To unsubscribe, send email to
  [email protected]

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to