[OpenSER-Users] Avp_db_query with timestamp??

Geir O. Jensen geir.o.jensen at uninett.no
Tue Apr 22 09:14:45 CEST 2008


> -----Original Message-----
> From: Daniel-Constantin Mierla [mailto:miconda at gmail.com] 
> On 04/21/08 16:21, Geir O. Jensen wrote:
> > I'm trying to get a timestamp from the sql server with the 
> following:
> >
> > avp_delete("$(avp(s:rds_time))");
> > avp_db_query("SELECT time FROM usr_status WHERE 
> > cid='$ci';","$(avp(s:rds_time))");
> >
> > HOWEVER, even if the time field is "2008-04-21 15:06:33" the avp is 
> > only filled with "2008". Any idea what's going on ??
> >   
> what is the type of the column in database and operating 
> system you are using?
> 
> There might be some issues on specific systems when 
> converting from datetime to string or integer values that are 
> used with AVPs. Try to wrap the datetime column with 
> DATE_FORMAT(...) or  UNIX_TIMESTAMP(...)
> -- these functions return string or integer values.

Ah, forgetting the ever necessary information :D It's on an Ubuntu (6.x)
server, and the field type is timestamp (mysql 5.x). I've since worked
around my problem, but would still like to have it fixed :D So if there are
no other explanations I'll experiment with the above formatting tips.

Thanks
Gojensen
UNINETT





More information about the sr-users mailing list