Questions tagged [android-date]

276 questions
0
votes
1 answer

Android, Right way to programticly format date time as time ago

Example, from 1 min ago i use api and time response result from Api service as: { "date_time":"2016-03-10 03:20:30" } Please discuss step by step, And if available how can programticly display it in Arabic format منذ 15 دقيقة My Code for date in…
0
votes
1 answer

android- how to create tomorrow date via Date class

I want to make tomorrow date via Date class , this is my code for making today's date : persianDatePicker.setDisplayDate(new Date()); how can I make tomorrow date via Date class ?
navid abutorab
  • 189
  • 1
  • 2
  • 9
0
votes
2 answers

How to get the value from DatePicker on Android

I have this DatePicker code, I can see the DatePicker and pick a date but nothing happens. How can I get the date and use it, probably show to the user? Here is my DatePicker code : private EditText et_tarih; @Override public void…
jason
  • 6,962
  • 36
  • 117
  • 198
0
votes
1 answer

How to get user's timezone and convert time saved in database according to the user's timezone? Please see details

I'm developing an app in which I'm saving the time when the post was posted. I'm getting that time by using this code: DateFormat currentTime = new SimpleDateFormat("h:mm a"); final String time =…
Hammad Nasir
  • 2,889
  • 7
  • 52
  • 133
0
votes
1 answer

How to show the time and date saved in my database to the user according to their local timezone? Please see details

I'm developing an app in which I'm saving the date and time in Firebase and then retrieving it for the user to see. What I want is I want user to see that time and date according to their local timezone. for ex - if the time and date saved in…
Hammad Nasir
  • 2,889
  • 7
  • 52
  • 133
0
votes
1 answer

Date with format and locale

I am trying to get the date with this pattern - "dd/MM/yyyy". So far i've used SimpleDateFormat to achieve it, but now i need to also support Chinese in my app and it's not giving me the result i need. I'm trying to make it look like the pattern…
gga
  • 107
  • 7
0
votes
1 answer

How to get whole month dates from a calendar instance and use it for any purpose?

Can anyone tell me how to get whole month dates from calendar instance in Android. I need these dates to do some operation in my app. Kindly suggest an easier way to do this.
irteza
  • 1
0
votes
2 answers

How to add time to another time - Android

I have timer for a task. And all the sessions will be added up to each other. Let's say today user spent 5 minutes Other day he spent 1 hour, here this one hour will be added to the 5 minutes and so on.. So it will be the total time in one…
MBH
  • 16,271
  • 19
  • 99
  • 149
0
votes
2 answers

Cannot convert String date into Date - Unparseable date error

I have date String in the following format - eg.: Thu, 17 Mar 2016 19:30:25 +0000 Sun, 06 Mar 2016 12:43:13 +0000 I want to convert this date into a more readable format: Thu, 17 Mar 2016 Sun, 06 Mar 2016 public static String…
Paul
  • 3,812
  • 10
  • 50
  • 73
0
votes
2 answers

Convert GMT date to IST

I am trying to convert GMT time to IST using the following piece of code: SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date date1 = sdf.parse("2015-01-25"); sdf.setTimeZone(TimeZone.getTimeZone("IST")); …
div
  • 1,475
  • 3
  • 22
  • 32
0
votes
2 answers

get year, month, day and time form "Tue, 12 Jan 2016 09:40:07 GMT" in Java/Android

I know these type of question asked lot's of time on lot's of website. Till I not got solution that's why I am putting this question here. I want year, month, date, date and time from date format Tue, 12 Jan 2016 09:40:07 GMT I am getting this date…
Vinit ...
  • 1,409
  • 10
  • 37
  • 66
0
votes
1 answer

Convert UTC time to Local android

I am getting UTC time from server for eg - "2016-01-04T06:27:23.92". I want to convert it to Jan 4,2016 and time in Local formate. I am using following code but its not working - Date localTime = new Date(commentDate); String format = "yyyy/MM/dd…
unflagged.destination
  • 1,576
  • 3
  • 19
  • 38
0
votes
0 answers

Different Android dates in emulator and real device

I'm experiencing a very strange problem with Date objects in Android, when I run the following code I get different dates in the emulator and in the real device. (str1 and str2 come from the following json result json file) String…
Carlos Hernández Gil
  • 1,853
  • 2
  • 22
  • 30
0
votes
0 answers

Android App crash using Date/Calendar

I have a problem, when I use Date and Calendar class my app crash, but everything work correctly by emulator and no one error throws. I need to convert rss pubDate in Date to get day, month and yers, later get week day and month as a string. This…
KPN24
  • 65
  • 2
  • 9
0
votes
3 answers

How do I display date and time separately from a give datetime function?

I am just plugging and playing with a sample code to get a hang of chatting/messaging apps. I am using a function gettimedate such that, in my model class I have the following: private volatile long mTimedate; public myclass(....,DateType…