android-date Questions

6

Solved

I'm getting date data from weather API in two versions. The first one is just string like this: 2019-08-07 09:00:00 and like this: 1565209665. How do I change it to just the name of the day or day ...
Pronator asked 7/8, 2019 at 20:41

3

Solved

I want to know the current device time format, meaning 24 hour/ 12 hour format. Please let me know how can I determine that. Are there any API there to determine this?
Gavette asked 11/7, 2011 at 12:4

30

Solved

I wrote the following code Date d = new Date(); CharSequence s = DateFormat.format("MMMM d, yyyy ", d.getTime()); I want the current date in string format, like 28-Dec-2011 so that I ca...
Cronk asked 28/12, 2011 at 10:58

10

I have Two String Datetime as follows: String Date1 = "05-09-2013 10:46:10" String Date2 = "06-09-2013 10:46:10" I Need to compare these datetimes and i need result.
Oller asked 10/9, 2013 at 12:16

9

Solved

I am using date converter class to convert my date object. However, I still encounter an error saying. error: Cannot figure out how to save this field into a database. You can consider adding a typ...
Chiaki asked 13/5, 2018 at 6:52

6

Im trying to format a Date to String using SimpleDateFormat, and the pattern im using is this one "yyyy-MM-dd'T'HH:mm:ss.SSSxxx" but when reach this line SimpleDateFormat sdf = new SimpleDat...
Embus asked 16/6, 2017 at 11:42

17

Solved

I have milliseconds. I need it to be converted to date format of example: 23/10/2011 How to achieve it?
Nectarous asked 31/10, 2011 at 12:29

7

Solved

I am working on a chat application but I am struggling to figure out how to display the calendar date on the top of chat messages; for example, something like this: Another image with timestamps...

11

Solved

I am new to Android and I am currently facing an issue to get current time given the timezone. I get timezone in the format "GMT-7" i.e. string. and I have the system time. Is there a clean way t...
Lay asked 24/4, 2013 at 21:59

5

Solved

How to get all dates between two dates in Android. For example. I have two Strings. String first="2012-07-15"; String second="2012-07-21"; I convert and get dates from these strings. DateFo...
Lineage asked 10/7, 2012 at 11:51

8

Solved

I have time in milliseconds, now I want to separate time and date from these milliseconds. how can i do this???
Rakehell asked 2/12, 2012 at 9:26

23

Solved

How do I display the current date and time in an Android application?
Ariannearianrhod asked 16/2, 2010 at 7:2

10

Solved

I am getting date value from database like "2013-02-27 06:06:30" using StringTokenizer I will get time separately like below String startTime = "2013-02-27 06:06:30"; StringTokenizer token = new...
Fluoroscope asked 18/4, 2013 at 13:35

4

Solved

Currently i am using the code below: String currentDateTimeString = DateFormat.getDateTimeInstance() .format(new Date()); From this i am getting the output in the following format - Jun 5, 2...
Largess asked 8/7, 2015 at 7:31

2

I know this question has been asked many times but i am unable to find the right direction. I have registered BroadcastReceiver which I want to trigger when the Android System Date is changed autom...
Laden asked 29/5, 2014 at 7:50

3

//explain public class DateLoop { static String finalDate; static String particularDate; public static void main(String[] args) { // TODO Auto-generated method stub SimpleDateFormat sdf = n...
Windhover asked 9/1, 2018 at 18:31

5

Suppose that my server located in USA and I live in Russia. We know that they have different time zones. My application getting text(String) from server. And this text data has Date column in data...
Sunbreak asked 11/8, 2013 at 7:18

3

Solved

I want to change my date format that is in as String date ="29/07/13"; But it is showing me the error of *Unparseable date: "29/07/2013" (at offset 2)* I want to get date in this format 29 Jul ...
Detwiler asked 29/7, 2013 at 7:33

5

Solved

I have a string containing a date in the format YYYY-MM-DD. How would you suggest I go about converting it to the format DD-MM-YYYY in the best possible way? This is how I would do it naively: i...
Typical asked 9/7, 2011 at 21:7

4

Solved

I want to parse the date into a desired format but i am receiving an exception every time. i know it is easy to implement but i am facing some problem don't know where exactly.: Exception: java.te...
Janise asked 4/6, 2014 at 6:45

4

Solved

How can I convert a date in dd / mm / yyyy to a format that supports sqlite yyyy-MM-dd'T'HH: mm: ss for example: public static String convertStringToData(String stringData) throws ParseExc...
Belva asked 7/5, 2013 at 19:7

2

Solved

I am formatting dates like this: public static String toFormattedDate(@NonNull Time time, String toFormat) { mDateFormat = new SimpleDateFormat(toFormat); Date date = new Date(); date.setTime...
Hijack asked 18/5, 2016 at 2:35

2

Solved

From reading about them I understand that the android class is a utility class made for convenience only, and provide nothing that SimpleDateFormat doesn't provide. Is there any significance to the...
Cicatrix asked 30/11, 2012 at 15:19

0

I've been wondering how one is supposed to properly test functionality that relies on date or time changes with Android. Lets say I have events that need to be processed on the first of every month...
Walli asked 13/5, 2014 at 13:15

2

I have saved dates by formatting them using SimpleDateFormat. DateFormat dateForm = new SimpleDateFormat("HH mm ss dd MMM ''yy"); String dateOutput = dateForm.format(new Date()); This uses the...
Middleoftheroad asked 11/2, 2014 at 18:18

© 2022 - 2025 — McMap. All rights reserved.