Class PelEntryTime

Description

Class for holding a date and time.

This class can hold a timestamp, and it will be used as in this example where the time is advanced by one week:

  1.  $entry $ifd->getEntry(PelTag::DATE_TIME_ORIGINAL);
  2.  $time $entry->getValue();
  3.  print('The image was taken on the ' date($time'jS'));
  4.  $entry->setValue($time 24 3600);

The example used a standard UNIX timestamp, which is the default for this class.

But the Exif format defines dates outside the range of a UNIX timestamp (about 1970 to 2038) and so you can also get access to the timestamp in two other formats: a simple string or a Julian Day Count. Please see the Calendar extension in the PHP Manual for more information about the Julian Day Count.

Located in /PelEntryAscii.php (line 172)

PelEntry
   |
   --PelEntryAscii
      |
      --PelEntryTime
Class Constant Summary
Method Summary
 PelEntryTime __construct (int $tag, int $timestamp, [int $type = self::UNIX_TIMESTAMP])
 int getValue ([int $type = self::UNIX_TIMESTAMP])
 void setValue (int $timestamp, [int $type = self::UNIX_TIMESTAMP])
Variables
Methods
Constructor __construct (line 232)

Make a new entry for holding a timestamp.

PelEntryTime __construct (int $tag, int $timestamp, [int $type = self::UNIX_TIMESTAMP])
  • int $tag: the Exif tag which this entry represents. There are only three standard tags which hold timestamp, so this should be one of the constants PelTag::DATE_TIME, PelTag::DATE_TIME_ORIGINAL, or PelTag::DATE_TIME_DIGITIZED.
  • int $timestamp: the timestamp held by this entry in the correct form as indicated by the third argument. For UNIX_TIMESTAMP this is an integer counting the number of seconds since January 1st 1970, for EXIF_STRING this is a string of the form 'YYYY:MM:DD hh:mm:ss', and for JULIAN_DAY_COUNT this is a floating point number where the integer part denotes the day count and the fractional part denotes the time of day (0.25 means 6:00, 0.75 means 18:00).
  • int $type: the type of the timestamp. This must be one of UNIX_TIMESTAMP, EXIF_STRING, or JULIAN_DAY_COUNT.

Redefinition of:
PelEntryAscii::__construct()
Make a new PelEntry that can hold an ASCII string.
getValue (line 258)

Return the timestamp of the entry.

The timestamp held by this entry is returned in one of three formats: as a standard UNIX timestamp (default), as a fractional Julian Day Count, or as a string.

  • return: the timestamp held by this entry in the correct form as indicated by the type argument. For UNIX_TIMESTAMP this is an integer counting the number of seconds since January 1st 1970, for EXIF_STRING this is a string of the form 'YYYY:MM:DD hh:mm:ss', and for JULIAN_DAY_COUNT this is a floating point number where the integer part denotes the day count and the fractional part denotes the time of day (0.25 means 6:00, 0.75 means 18:00).
int getValue ([int $type = self::UNIX_TIMESTAMP])

Redefinition of:
PelEntryAscii::getValue()
Return the ASCII string of the entry.
setValue (line 310)

Update the timestamp held by this entry.

  • todo: How to deal with timezones? Use the TimeZoneOffset tag 0x882A?
void setValue (int $timestamp, [int $type = self::UNIX_TIMESTAMP])
  • int $timestamp: the timestamp held by this entry in the correct form as indicated by the third argument. For UNIX_TIMESTAMP this is an integer counting the number of seconds since January 1st 1970, for EXIF_STRING this is a string of the form 'YYYY:MM:DD hh:mm:ss', and for JULIAN_DAY_COUNT this is a floating point number where the integer part denotes the day count and the fractional part denotes the time of day (0.25 means 6:00, 0.75 means 18:00).
  • int $type: the type of the timestamp. This must be one of UNIX_TIMESTAMP, EXIF_STRING, or JULIAN_DAY_COUNT.

Redefinition of:
PelEntryAscii::setValue()
Give the entry a new ASCII value.

Inherited Methods

Inherited From PelEntryAscii

 PelEntryAscii::__construct()
 PelEntryAscii::getText()
 PelEntryAscii::getValue()
 PelEntryAscii::setValue()

Inherited From PelEntry

 PelEntry::getBytes()
 PelEntry::getComponents()
 PelEntry::getFormat()
 PelEntry::getIfdType()
 PelEntry::getTag()
 PelEntry::getText()
 PelEntry::getValue()
 PelEntry::setIfdType()
 PelEntry::setValue()
 PelEntry::__toString()
Class Constants
EXIF_STRING = 2 (line 181)

Constant denoting a Exif string.

JULIAN_DAY_COUNT = 3 (line 185)

Constant denoting a Julian Day Count.

UNIX_TIMESTAMP = 1 (line 177)

Constant denoting a UNIX timestamp.

Documentation generated on Tue, 19 Dec 2006 01:08:19 +0100 by phpDocumentor 1.3.0 SourceForge.net Logo