News Feed
Jobs Feed
Sections




Recent Jobs

News Archive
feed this:

Ibuildings techPortal:
Tips for PHP Date and Time Functions
January 26, 2010 @ 10:06:57

In this new post from the Ibuildings techPortal today Michael shares some handy tips for working the date and time functions in PHP (all can be used in a non-PHP 5.3 installation).

His tips for these very handy functions include:

  • A Unix timestamp is never timezone-specific; if you call time() at the same moment on computers in different time zones, you get exactly the same value back.
  • The time string is interpreted as a local time; there is no gm- equivalent [of strptime], or even any way to simulate one, since it ignores the value of date_default_timezone_set. Note that you can impose a timezone on the input string if it contains a timezone abbreviation or offset.
  • [With date/gmdate] as with strftime/gmstrftime, the gm- prefix affects whether the result is a representation of the time in the current timezone or in the UTC timezone.
  • How does PHP know what your current timezone is? It tries a few different places, including the TZ environment variable and the date.timezone ini option.
1 comment voice your opinion now!
date time tip feature



Symfony Blog:
Using Propel 1.4 detailed logging
November 12, 2009 @ 07:50:37

On the Symfony blog today there's a new post by Fabian Lange about using the detailed logging ability of the newly released version of Propel (the database abstraction layer).

Today Propel 1.4 was released and it contains some debugging goodies. We can use the DebugPDO class to get the nifty logging into the Web Debug Panel. However some more interesting information is turned off by default by Propel.

Features include time logging, memory logging and slow query logging - all that are simple to enable in your configuration under the details for your propel connection. You can see an example of the output from the logging here.

0 comments voice your opinion now!
detailed logging time memory slowquery


PHPFreaks.com:
Working with dates in PHP
August 20, 2009 @ 11:38:51

On PHPFreaks.com today there's a new tutorial looking at working with dates and times in PHP. This includes timezone support and date manipulation.

There are many topics on the forums that go again, topics many people often are having trouble with. One of these problem areas are how to handle dates, convert them to a different format, timezone issues, etc. This tutorial will attempt to address many of the commonest problems related to date and time issues.

Besides looking at some of the common date/time issues that developers might face, they also touch briefly on storing dates in a database and offer some recommendations as to a few best practices to help keep things straight.

0 comments voice your opinion now!
date time tutorial database


Federico Cargnelutti's Blog:
Format a time interval with the requested granularity
June 25, 2009 @ 12:56:51

Federico Cargnelutti has posted a class (DateIntervalFormat) that gives you the difference between a date and "now" in words rather than an integer.

This class, a refactored version of Drupal's format_interval function, makes it relatively easy to format an interval value. The format will automatically format as compactly as possible. For example: if the difference between the two dates is only a few hours and both dates occur on the same day, the year, month, and day parts of the date will be omitted.

So, instead of getting a value of "86400 seconds" you'd get back something like "5 days 3 hours".

0 comments voice your opinion now!
tutorial granularity time format


php|architect:
php|a releases new Guide to Date & Time Programming
April 27, 2009 @ 08:47:28

The php|architect publishing group has released a new book from Derick Rethans dealing with time/date handling in PHP - php|architect's Guide to Date and Time Programming.

If your development involves working with dates and times, then this book is a must-have. In this book, Derick Rethans (contributor to PHP's core date extension and well-known PHP expert) explores in great detail the subtle nuances of working with dates and times. Frequently PHP developers encounter unexpected results that adversely affect their software and web applications.

The book includes topics like: working with calendars, parsing date/time strings, correctly using the DateTime object and working with dates when you can't get a timestamp. You can find out more on the book's page on the php|architect website.

0 comments voice your opinion now!
date time programming derickrethans book release phparchitect


ParticleTree Blog:
PHP Quick Profiler
April 24, 2009 @ 07:57:01

Debugging resources being used by your script has always been a pain, and many developers have come up with their own libraries to handle the process. Ryan Campbell has his own entry in the category - the PHP Quick Profiler.

In our company, code reviews play an integral part in the development process for making quality software. We opt for a mentor style approach with Wufoo, where a developer works on a segment for a period of time and then passes it up to a more experienced developer for review.

[...] To reduce this repetition of checking the same requirements over and over], we invested some time creating something we've called the PHP Quick Profiler-we call it PQP for short. It's a small tool (think Firebug for PHP) to provide profiling and debugging related information to developers without needing them to add a lot of programmatic overhead to their code.

The post gives several screenshots of the tool in action and code to get you up and running quickly. The Profiler can keep track of memory usage, "runaway" includes, execution time and database activity. There's also an online demo so you can try it out yourself.

Here's the link to the latest version's download.

0 comments voice your opinion now!
demo time execution include database usage memory profile


Ibuildings techPortal:
Buy vs. Build
April 15, 2009 @ 16:32:55

On the Ibuildings techPortal site Stefan Koopmanschap has written up some thoughts on one of the eternal struggles development shops face - whether to buy or build the software they need (either for themselves or their clients).

One of the biggest struggles in any software development company is "Buy vs. Build". How do you strike a balance between writing custom software and purchasing off-the-shelf solutions. This is something that is very hard and everyone gets it wrong every once in a while. In this article we will explore the way that Ibuildings approaches this issue, in the hopes that it helps others in getting it right more often.

He talks about considerations made on both sides - how flexible is the application, what is on-hand that could be adapted - and how the base product they might have purchased can act as a based to work from (like a content management system). There's no overall recommendation, though - too much of the decision depends on what's needed at the time and the capabilities of the technical staff employed.

0 comments voice your opinion now!
buy build techportal develop consideration cost time


PHPBuilder.com:
PHP and Adobe Air Building a Time-tracking and Billing Application - Part II
April 07, 2009 @ 07:54:44

PHPBuilder.com has posted the second part of their series on creating a sample application - a time tracking app - with PHP and Adobe Air.

Welcome back. In part 1 of this series, you created some PHP remote services and the Clocked! widget application. Part 2 covers PHP administration and completion of the timer widget.

They're developing a Flex-based application (rather than the HTML/Javascript combo that can also be used with Air) so they'll be doing their work in Flex Builder. They set up a few placeholder functions like getClients, getProjects and getProjectsResult as well as support for the ticket and timer objects. Add in a few interface items like dropdowns for client and project selection and a start/stop button and you have the basic app laid out. The PHP interface to all of this Flex code comes in the next article of the series.

0 comments voice your opinion now!
time track air adobe tutorial series billing application flex builder


PHPBuilder.com:
Building a time-tracking and billing application with Adobe AIR and PHP
March 19, 2009 @ 07:58:59

On PHPBuilder.com today there's a new tutorial by Richard Bates that will walk you through the creation of a simple time tracking application that combines the Adobe Air and PHP technologies to make a simple desktop client.

The scenario calls for a lightweight, cross-platform desktop application that does its job and stays out of the users' way. It also needs a powerful management interface that can be accessed from anywhere. To address both needs, you first create a desktop application for AIR that leverages PHP back-end services for persistent storage and extra horsepower. Then, you create a simple and quick PHP/Hypertext Markup Language (HTML) browser-based interface for management and output applications.

The Air client is really just a frontend to the PHP backend located on the server (so there's no need to install PHP locally too). The system is based around a few objects - the Client, a Project, a time-tracking Ticket and an Invoice for the time spent. To make things simpler, he uses an instance of the Zend Framework to do most of the heavy lifting on the backend.

The rest of this article sets up the backend scripts - creating the service interface and making some of the initial methods (like getClients and logIn). The next part in the series will get into the actual Air application.

0 comments voice your opinion now!
air adobe desktop time track application tutorial


Daniel Cousineau's Blog:
Calculating Daylight Savings Time Boundary In PHP
March 11, 2009 @ 12:02:15

Daniel Cousineau has written up some timely advice in a new post to his blog. It looks at pinpointing the time boundary for Daylight Savings Time in a PHP script (when it starts and when it ends).

I had an issue recently where I needed to calculate the Unix timestamp for the daylight savings time boundaries. According to the United States Naval Observatory, daylight savings time begins the Second Sunday of March and ends on the First Sunday of November.

He looks at using the strtotime function to calculate these dates but points out some quirks - like what happens when you just give it a month or something like "second Sunday". His solution was to go back one day ("March 0" instead of "March 1") and calculating the time from there, including that first full day of March in the calculation.

0 comments voice your opinion now!
calculate daylight savings time boundary march november strtotime



Community Events









Don't see your event here?
Let us know!


developer podcast drupal wordpress microsoft framework extension conference symfony sqlserver feature job zendframework performance release zend facebook codeigniter opinion windows

All content copyright, 2010 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework