News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

NetTuts.com:
Dates and Time - The OOP Way
October 24, 2013 @ 11:49:23

On NetTuts.com today there's a new tutorial they've posted showing how to use PHP's DateTime functionality in a more OOP kind of way. The DateTime extension lets you work both ways - procedural and OOP, with only slightly different syntax changes between them.

The Date/Time PHP extension is a set of classes that allow you to work with almost all of the date and time related tasks. It's been available since the release of PHP 5.2 and the extension introduced several new classes.

The tutorial first shows you some of the differences between just working with something like date and DateTime. From there they get into a bit more complicated things like:

  • Modifying dates/times
  • Working with multiple dates
  • Working with timezones
  • Using DatePeriods
  • Extending the current functionality

There's also two more "real world" usage scenarios included - defaulting to using UTC times and using the DateInterval to handle subscription payment logic.

0 comments voice your opinion now!
datetime tutorial oop introduction date time

Link: http://net.tutsplus.com/tutorials/php/dates-and-time-the-oop-way/

blog comments powered by Disqus

Similar Posts

Tim Koschuetzki's Blog: How To Transform HTML To Textile Markup - The CakePHP TextileHelper Revisite

SitePoint PHP Blog: How to Build an OctoberCMS Theme

VG Tech: Swagger Docs in ZF2 with Examples - Part 1: Setup and Annotations

Sudheer Satyanarayana's Blog: A Bit Of XML, RSS And CURL In 7 Lines Of PHP And A Useful Program

Master Zend Framework: Using Sessions In Zend Framework 2 - Part 1


Community Events

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


laravel part2 php7 series framework language opinion programming example list symfony composer interview yii2 project community api introduction podcast application

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