I am currently working on my project for my professional course. I am implementing a digital diary. I would be having a diary page (a multiline textbox maybe) And a TextView on top to show the current DATE (without time). How do I show a NON-editabale textbox with today's date shown in it.
Asked
Active
Viewed 1,039 times
3 Answers
0
In order to get the current date and time use the below Links and iin order make it non editable in XML file make editable = false also focusable = false.

Community
- 1
- 1

Shankar Agarwal
- 34,573
- 7
- 66
- 64
0
its simple
Date dt = new Date();
int date = dt.getDate();
int month = dt.getMonth()+1;
int year = dt.getYear();
year += 1900;
int day = dt.getDay();
String[] days = { "Sunday", "Monday", "Tuesday","WednesDay", "Thursday", "Friday", "Saterday" };
String curDate = date + "/" + month + "/" + year + " " + days[day];

Chirag Patel
- 11,416
- 3
- 26
- 38
0
Use this code :
String mydate = java.text.DateFormat.getDateTimeInstance().format(Calendar.getInstance().getTime());
It 'll print : Feb 5, 2013, 12:35:46PM

Manish Dubey
- 4,206
- 8
- 36
- 65