Java tutorial
//package com.java2s; /* * Copyright (C) 2017 Florian Dreier * * This file is part of MyTargets. * * MyTargets is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * MyTargets is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ import android.support.annotation.NonNull; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { @NonNull static String getBackupName() { SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss", Locale.US); return "MyTargets_backup_" + format.format(new Date()) + ".zip"; } }