I do have such one, you may try to use it:

char * AGUTIL_get_date_and_time (time_t * tv,
                                 size_t * len)
{
  typedef struct snmp_data_and_time_s {
    unsigned short year;
    unsigned char  month;
    unsigned char  day;
    unsigned char  hour;
    unsigned char  minutes;
    unsigned char  seconds;
    unsigned char  deci_seconds;
    unsigned char  direction_from_UTC;
    unsigned char  hours_from_UTC;
    unsigned char  minutes_from_UTC;
  } DT_T;
  static DT_T dtt;
  unsigned short iday;
  struct tm * tm_data = gmtime(tv);
  iday = tm_data->tm_year + 1900;
  dtt.year = htons(iday);
  dtt.month = 1 + tm_data->tm_mon;
  dtt.day = tm_data->tm_mday;
  dtt.hour = tm_data->tm_hour;
  dtt.minutes = tm_data->tm_min;
  dtt.seconds = tm_data->tm_sec;
  dtt.deci_seconds = 0;
  *len = 8;
  return (char *) &dtt;
}


Wes Hardaker wrote:
>>>>> On Mon, 15 Nov 2004 13:11:42 +0100 (MET), "Sven Jonas" <[EMAIL PROTECTED]>said:

Sven> is there any funtion that converts an u_char time[11] to a
Sven> time_t-Struct?

Nope, but if you write one please send it to us!

--
Wes Hardaker
Sparta




Find local movie times and trailers on Yahoo! Movies.

Reply via email to