If you want show date,time in your program, can use this class.
'SimpleDateFormat' is useful class.
This class is java class.
But we use in android.
We can referenced Oracle document.
This figure is variable for SimpleDateFormat.
I introduce some examples.
If current date&time is 2014-03-07 12:00pm.
time==>12:00
If you want add 'am or pm'.- String time=CurtimeFormat.format(date);
time==> pm 12:00
If you want show current date
currentdate==> 2014-03-07
If you want add day in week, just add 'E'
currentdate==> 2014-03-07 Fri
No comments:
Post a Comment