<?php

/*
 * tnef_date.php
 *
 *  Bernd Wiegmann <bernd@wib-software.de>
 *  (c) 2003 (GNU GPL - see ../../COPYING)
 *
 */

/*
 *   $Header: /storage/repository/attachment_tnef/tnef_date.php,v 1.1 2003/07/31 15:24:25 bernd Exp $
 *
 *   $Log: tnef_date.php,v $
 *   Revision 1.1  2003/07/31 15:24:25  bernd
 *   Complete rework of tnef decoder
 *
 *
 */

class TnefDate {

  var $year;
  var $month;
  var $day;
  var $hour;
  var $minute;
  var $second;

  function TnefDate() {
  }

  function setTnefBuffer($buffer) {
    $this->year = tnef_geti16($buffer);
    $this->month = tnef_geti16($buffer);
    $this->day = tnef_geti16($buffer);
    $this->hour = tnef_geti16($buffer);
    $this->minute = tnef_geti16($buffer);
    $this->second = tnef_geti16($buffer);
  }

  function getString() {
    return sprintf("%04d-%02d-%02d %02d:%02d:%02d",
		   $this->year, $this->month, $this->day, $this->hour, $this->minute, $this->second);
  }
}

?>