Hi all, It seams we mix here something. We do parsing but if only if we have
problem we entry in branch and call date_convert_universal(): if
(octstr_parse_long(&unitime.second,
tempstr, 10, 10) != 12 || (octstr_delete(tempstr, 10, 2), octstr_parse_long(&unitime.minute, tempstr, 8, 10)
!= 10) || (octstr_delete(tempstr, 8, 2), octstr_parse_long(&unitime.hour, tempstr, 6, 10) != 8)
|| (octstr_delete(tempstr, 6, 2), octstr_parse_long(&unitime.year, tempstr, 4, 10) != 6)
|| (octstr_delete(tempstr, 4, 2), octstr_parse_long(&unitime.month,
tempstr, 2, 10) != 4) || (octstr_delete(tempstr, 2, 2), octstr_parse_long(&unitime.day, tempstr, 0, 10) != 2))
{ error(0, "EMI delivery time stamp
looks malformed"); notime: time(&msg->sms.time); } else
{ unitime.year += 2000;
/* Conversion function expects full year */ msg->sms.time = date_convert_universal(&unitime); } And
about date_convert_universal in date.c May
be I mistake but it’s look like we use that to get time in Unix format in
case of broken timestamp not reverse. MO
time stamp is correct all you need to format it as you want. Dima. -----Original Message----- I recently began to work
with a EMI2 smsc link, and have a question about the calculation of the
timestamps for the MO messges. First, the code at
smsc_emi2.c splits day,month,year, and so on, and then it takes the
corresponding time_t by calling date_convert_universal. The question is the
timestamp I'm getting in the msg->sms.time variable is one month ahead the
real one. For example for the EMI2 timestamp "140102185129" I
get a timestamp representing "14/02/2002 18:51:29 UTC". I think the problem is in de
date.c function date_convert_universal: line
81: date += monthstart[t->month] * DAY; Shouldn't it be line
81: date += monthstart[t->month-1] * DAY; ? Or am I doing something
wrong? I need exacts timestamps
because we have to do accounting fo the sms traffic. Angel Fradejas. |
- timestamps with emi2 Angel Fradejas
- RE: timestamps with emi2 Angel Fradejas
- RE: timestamps with emi2 Dima Milentiev
- RE: timestamps with emi2 Angel Fradejas
- Re: timestamps with emi2 Stipe Tolj
- RE: timestamps with emi2 Angel Fradejas
- Re: timestamps with emi2 Stipe Tolj