You are here: Re: [PHP] Week Days « PHP « IT news, forums, messages
Re: [PHP] Week Days

Posted by Robert Cummings on 10/19/49 11:24

On Fri, 2005-08-19 at 11:17, Jordan Miller wrote:
> Yo,
>
> All you need is the mktime() command.
>
> do something like:
> $futureDate = date("Y-m-d", mktime(0, 0, 0, $month, $today+
> $daysToAdd, $year));
>
> Jordan
>
>
> http://www.php.net/mktime
> mktime() is useful for doing date arithmetic and validation, as it
> will automatically calculate the correct value for out-of-range
> input. For example, each of the following lines produces the string
> "Jan-01-1998".
>
> <?php
> echo date("M-d-Y", mktime(0, 0, 0, 12, 32, 1997));
> echo date("M-d-Y", mktime(0, 0, 0, 13, 1, 1997));
> echo date("M-d-Y", mktime(0, 0, 0, 1, 1, 1998));
> echo date("M-d-Y", mktime(0, 0, 0, 1, 1, 98));
> ?>

All fine and dandy... but he said WEEKDAYS, so adding 5 days to a given
day must non deduct from the 5 days when a weekend day is passed. This
kind of calculation is useful for banks and other businesses that only
process transactions on business days (which happen to be weekdays).

Cheers,
Rob.

> On Aug 19, 2005, at 12:57 AM, benc11@gmail.com wrote:
>
> > I am trying to add 3 (or a user-defined amount) week days to a
> > certain date..
> > An example is today 2005-08-18 then adding 3 week days to give me a
> > date of
> > 2005-08-23. I have tried searching online but cannot find an easy
> > way of
> > doing so.
> >
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация