Giter VIP home page Giter VIP logo

Comments (5)

tplaner avatar tplaner commented on August 20, 2024

You are correct, last day of wasn't added until 5.3 according to the comments on http://us.php.net/manual/en/datetime.formats.relative.php

If you would like, feel free to fork the project, and submit a pull request with your modifications. If not I should have some time to look into/fix this issue over the weekend.

Thank you for pointing this out.

from when.

freshface avatar freshface commented on August 20, 2024

Is this fixed?
I have this error:

Warning: DateTime::modify() [datetime.modify]: Failed to parse time string (last day of 1 month) at position 9 (o): The timezone could not be found in the database in /home/figure8/domains/billing.figure8.be/external/When.php on line 624

from when.

barlow avatar barlow commented on August 20, 2024

Hi Frederik,

No, not fixed.

I use the modification mentioned in the post, this works with the
earlier PHP version.

So clause around line 624 in my version of When.php is this:

if($interval == "month")
{
//cjb 'last day of 1 month' does not work
//$this->try_date->modify('last day of ' . $this->interval . ' ' .
$interval);
//$this->try_date->modify('+ ' . $this->interval . ' ' . $interval);

  for ($i=0; $i< $this->interval; $i++)
  {
     $this->try_date->modify('+ 28 days');
     $this->try_date->setDate($this->try_date->format('Y'), 

$this->try_date->format('m'), $this->try_date->format('t'));
}
}

Does that help?
Chris

On 11/10/2011 1:41 AM, Frederik Heyninck wrote:

Is this fixed?
I have this error:

Warning: DateTime::modify() [datetime.modify]: Failed to parse time string (last day of 1 month) at position 9 (o): The timezone could not be found in the database in /home/figure8/domains/billing.figure8.be/external/When.php on line 624


Reply to this email directly or view it on GitHub:
#5 (comment)

from when.

freshface avatar freshface commented on August 20, 2024

It fixes it, thx.

from when.

outrunthewolf avatar outrunthewolf commented on August 20, 2024

This works, but it doesn't give accurate dates. Which is whay I turned to "last day of" in the first place Perhaps i'm doing something wrong?

from when.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.