transform sunposition from JS to SQL