java - how to: long to Date to String? -
I'm really stuck in I have to convert a long date to any date. Next I want to write the month, changed to a string. I want to display the month on a text view But displaying a string on the textview is not a hassle.
I have tried:
date DT = new date (); Calendar cal = calendar.justinstance (); Cal.setTime (dt); // Get the long date of current time = link = calendar. GetTimeInMillis (); // Get the current time as time CalendarView.setDate (dateAsLong); View View Calendar Current Date TextView TV = (TextView) findViewById (R.id.TextViewDate); Tv.setText (String.valueOf (dateAsLong)); // & lt; - But this is wrong
thanks in advance!
get date from the first long
long value = 1346524199000l; Date Date = New Date (Val); SimpleDateFormat df2 = New SimpleDormat ("MMM"); String month = df2.format (date);
Once you are running the string in the form of a month, use the code below to convert it to the android text view only
textview SetText (month);
Comments
Post a Comment