write query for get times from datastoreservice