 the php datetime object the datetime object is defined in php versions 52 and greater full documentation can be found at phpnet datetime  php s printr    devel module  s dpm   and similar functions and most debuggers are not able to show the properties of datetime objects the dateformat  function provides a good alternate method to debug datetime objects an example of its usage follows including some common datetime manipulation functions php create a datetime object for 11 november 2008 5pm chicago time date datecreate 20081111 170000 timezoneopen america chicago find out what time it is in new york datetimezoneset date timezoneopen america newyork now move it ahead to the following tuesday datemodify date 1 tuesday print out the result print dateformat date l r tuesday tue 18 nov 2008 180000 0500 the date api provides a helper function datemakedate string timezone type where string is a unixtimestamp an iso date or a string like yyyymmdd hh mm ss timezone is the name of the timezone this date is in and type is the type of date it is dateunix dateiso or datedatetime it creates and return a date object set to the right date and timezone  