Electricity consumption comprises a significant fraction of total operating cost in data centers. System operators are required to reduce electricity bill as much as possible. In this paper, we consider utilizing available energy storage capability in data centers to reduce electricity bill under real- time electricity market. Laypunov optimization technique is applied to design an algorithm that achieves an explicit tradeoff between cost saving and energy storage capacity. As far as we know, our work is the first to explore the problem of electricity cost saving using energy storage in multiple data centers by considering both time- diversity and location-diversity of electricity price.