Reply to Re: Calculate Days Worked

Your name:

Reply:


Posted by Michael Fesser on 06/14/07 21:23

..oO(howzit)

>I don't want to edit my SELECT statement - as his answer would
>suggest.

Why not? That would be the easiest and most reliable way.

>I need the SELECT statement to stay as it is.

Whenever possible you should let the database do all the dirty work.
It's very good at handling things like date calculations and does it
much more efficient than PHP.

>I was hoping
>for a function that would manipulate the one instance that I am
>needing.

In PHP you would have to turn the date into a Unix timestamp (strtotime)
and calculate the difference to the current date. Two things might
become an issue in some situations:

* daylight saving time
* Unix timestamp restrictions (1970-2038 on many systems)

There's also a calendar extension in PHP for doing Gregorian and Julian
date calculations, but this is not always available.

So, as said, let the DB do it if possible.

Micha

[Back to original 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

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