Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static String getNowDataForTextView() { return Calendar.getInstance().get(Calendar.YEAR) + "-" + getNowDataForChart(); } public static String getNowDataForChart() { Calendar calendar = Calendar.getInstance(); int month = calendar.get(Calendar.MONTH) + 1; int day = calendar.get(Calendar.DAY_OF_MONTH); return month + "-" + day; } }