Questions tagged [android-date]

276 questions
-1
votes
4 answers

Change date string format in android

I am getting date string from XML parsing like this: 2012-04-05 07:55:29 +05.30 Now, I want this string as : 05-April-2012 How can I do this?
Amith
  • 127
  • 1
  • 4
  • 11
-1
votes
5 answers

android - java.lang.IllegalArgumentException when no of days difference between two date

In my app i count no of days difference between old date and new date with the following code. it work good on android 2.2 and 2.3.6 devices but on android 4.0 device it is get crashed with java.lang.IllegalArgumentException. i do not know sdk 4.0…
M.A.Murali
  • 9,988
  • 36
  • 105
  • 182
-2
votes
1 answer

how to compare two date with my get date in android

In the below code, I want to compare a start date and an end date with my schedule date. I want to find within a week how many tasks are availables. Suppose 16-03-2020 is the start date and 22-03-2020 the end date, my schedule date are like this 16…
user13012007
-2
votes
3 answers

how to convert the date to timestamp through code

how to convert the current date to time-stamp through code String timeFormat = "dd.MM.yy, h:mm a"; Calendar c = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat(timeFormat); String formattedDate =…
Martin j
  • 511
  • 1
  • 9
  • 31
-2
votes
3 answers

How can I reformat date and time?

How can I convert 24 hours time format into 12 hours format? I know this question has been asked many times, but my problem is different. My current time is: Tue Nov 07 18:44:47 GMT+05:00 2017 I just want 6:44 pm from my date time. I tried…
Innocent
  • 703
  • 10
  • 21
-2
votes
2 answers

How can I Convert timestamp String to Date in Android

I want to convert timestamp to date in android, I tried this code but not get expected result. My Code Is. String timeStampST = "2016-12-13 09:47:11"; SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); Date convertedDate = new…
byteC0de
  • 5,153
  • 5
  • 33
  • 66
-2
votes
1 answer

Getting SQLiteException: near "Nov": syntax error (code 1)

I am trying to develop a local db with the help of Active android.In model class I have a field called updated_date which is a string.I have converted the string updated_date to Date format and trying to compare the field with today's date in where…
ananya
  • 43
  • 4
-2
votes
1 answer

Unparseable date. Parse Exception comparing two dates

I am trying to produce a list based on a date. I keep getting a Parse exception. I thought I had the dates in the exact same format. Maybe I missed something. I have played with this for hours with no success. Any help would be appreciated. public…
SmulianJulian
  • 801
  • 11
  • 33
-2
votes
6 answers

android date format: how to get the format from string

I am getting this 14-03-2014 09:02:10 string from JSON. All is OK but I want just the date part in this string not the time (14-03-2014). So how can I convert the string to this format.
Abid Khan
  • 2,451
  • 4
  • 22
  • 45
-3
votes
1 answer

System.currentTimeMillis() gets disturbed when user manually changes time

I am building application which is time sensitive i.e. some tasks need to be completed within certain time. There are multiple ways to get the time i.e. System.currentTimeMillis() and gpsLocation.getTime(). I don't want to use…
Mustansar Saeed
  • 2,730
  • 2
  • 22
  • 46
-3
votes
2 answers

How to check if the date changed in android studio?

I would like to know if the date changed because I need to refresh a variable the next day. Date currentTime = Calendar.getInstance().getTime(); date = (TextView) findViewById(R.id.currentTime); SimpleDateFormat dateFormatter = new…
asia92
  • 5
  • 4
-3
votes
2 answers

Android String date "2017-09-04T07:09:30.269+00:00" convert to long

I received the date string from the notification server in the following format. 2017-09-04T07:09:30.269+00:00 I want it to convert to long to save in database. public static long convertStringDatetoLong(final String date, final String inputFormat)…
rodent_la
  • 1,195
  • 4
  • 18
  • 38
-3
votes
1 answer

How to create android time in JSON Format

I want to get the current time and convert it to JSON Format as shown below: '2015-11-02T17:22:04.184+00:00' The Date and DateFormat doesn't appear to have a method to do this. Does anyone know how this can be done? EDIT: This is not a duplicate…
DMC
  • 1,184
  • 5
  • 21
  • 50
-3
votes
2 answers

Convert date into "17. December 2015" Format

I am getting date in form of "20150119" and I want to convert it into the format like: "19. January 2015" . How can I convert date in such format. I tried below code: private void convertDate() { String m_date = "20150119"; …
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
-3
votes
4 answers

How to sort list of dates in defending order in yyyy-MM-ddTHH:mm:ss.SSS formte

I have a list of dates is yyyy-MM-ddTHH:mm:ss.SSS formate. I want to sort these dates in Ascending and Descending order. Is there any collection method to sort these dates? How can I sort these dates Thanks in Advance
unflagged.destination
  • 1,576
  • 3
  • 19
  • 38
1 2 3
18
19