Questions tagged [android-date]

276 questions
-4
votes
1 answer

How do you get create a date and get only the month?

What is the proper way to make a date in android? "Date date = new Date, date = 1995/06/10"? Also, how do i get a only the month of the date? most of the tutorials around have a simpledateformat with the "YYYY-MMD-dd HH mm ss", but how do i grab…
-4
votes
3 answers

Cannot get return right in this date and month method - Android Studio

I have been fiddling around with this method that I created and cannot manage to get it to work. I either get string cannot be converted to int or require a return, but then I cannot enter the monthString variable in the return statement as it is…
user2921885
  • 159
  • 11
-4
votes
2 answers

Compare date and Time without changing their format and find nearest value among them

I have list of dates: 23/08/2014 8:23:23 24/08/2014 5:23:23 24/08/2014 6:23:23 24/08/2014 7:23:23 24/08/2014 7:25:23 24/08/2014 8:23:23 I want to compare all dates to current date time and find the closest date time. Is there any simple way to…
isha
  • 349
  • 2
  • 12
-4
votes
2 answers

How set date as today, 1 day, 2 day and etc

I have date array and i set data in my list. holder.getDayReceipt().setText(receiptList.get(position).getCreatedDate().toString()); I need set date in this format: Today (16 June) 1 day (15 June) 2 day (14 June) .............. How do it? EDIT:…
ip696
  • 6,574
  • 12
  • 65
  • 128
-4
votes
1 answer

How to format a timestamp in android

I'm new in android how do I format this "2013-07-02T04:17:24Z" into July 02, 2013 12:00 PM Thanks in advance! EDIT: Here is my code. Is there anything wrong in my code: SimpleDateFormat sdf1 = new SimpleDateFormat("MMMM dd, yyyy"); String…
Lian
  • 1,597
  • 3
  • 17
  • 30
-5
votes
1 answer

Exception on Date parsing android

I am using a function to take out the difference between a given date and current date. At all the places, that function is working just fine but at one place, it is throwing the unparseable date exception. Below is the function that I use: public…
1 2 3
18
19