Set role expiry programmatically in uc_roles_expirations table? I am moving a site to drupal. In that site role expire was manually set by admin.

In my drupal site I want this with the use of ubercart recurring subscription.

So how can I set a role expiration date programmatically which will work as we assign a role in features of any product purchase?
Solved Just by Database entry :

$expiredate = date('U', strtotime($expiry));
    db_insert('uc_roles_expirations')
    -&gt;fields(array(
      'uid' =&gt; $uid,
      'rid' =&gt; 6,
      'expiration' =&gt; $expiredate,
    ))
    -&gt;execute();