Here you can find the source of generateFileName()
String
public static String generateFileName()
//package com.java2s; /* Copyright (c) Inmobia Mobile Technology, Inc. All Rights Reserved. * /* ww w .ja va 2 s. c o m*/ * This software is the confidential and proprietary information of Inmobia * Mobile Technology. ("Confidential Information"). You shall not disclose such * Confidential Information and shall use it only in accordance with the terms * of the license agreement you entered into with Inmobia Mobile Technology. * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { /** * formatter,used to format date */ private static SimpleDateFormat formatter; /** * * Generates and returns a new file name by appending the current date in * front of the file name * <p> * * @return<code>String</code> */ public static String generateFileName() { formatter = new SimpleDateFormat("yyyy-MM-dd"); return formatter.format(Calendar.getInstance().getTime()) + "_Giant.xls"; } }