android get current Time
2014-01-16 01:06
351 查看
Today ,I want to pick up the android,so I write down a little demo,in the demo I most use the date,so I check some information,and read it down in case I will forget it.
Time time = new Time();
time.setToNow(); //It is very important,it's easy to be ignored.
then you can get the year,month,day& time
int year = time.year;
int month = time.month; //month is the current month -1,means month is the index of monthes。
int day=time.monthday;
textview.setText(year+“-”+month+"-"+day);
Time time = new Time();
time.setToNow(); //It is very important,it's easy to be ignored.
then you can get the year,month,day& time
int year = time.year;
int month = time.month; //month is the current month -1,means month is the index of monthes。
int day=time.monthday;
textview.setText(year+“-”+month+"-"+day);
相关文章推荐
- Get current time and date on Android
- System.currentTimeMillis,getTimeInMillis与new Date().getTime获取当前时间戳耗时比较
- System.currentTimeMillis,getTimeInMillis与new Date().getTime获取当前时间戳耗时比较
- 注意GetCurrentTime()
- GetCurrentTime函数
- Groovy get current time
- API GetCurrentTime Hum!noned1
- API GetCurrentTime Haley, sd1
- Android时间间隔 SystemClock.uptimeMillis 和 System.currentTimeMillis
- get the current system time and print it
- System.currentTimeMillis,getTimeInMillis与new Date().getTime获取当前时间戳耗时比较
- System.currentTimeMillis,getTimeInMillis与new Date().getTime获取当前时间戳耗时比较
- MyGetCurrentTime 驱动获取当前时间
- 调试函数耗时的利器CFAbsoluteTimeGetCurrent
- COleDateTime::GetCurrentTime()报错问题
- Android中的时间:currentTimeMillis,uptimeMillis,elapsedRealtime
- GetCurrentTime函数
- System.currentTimeMillis,getTimeInMillis与new Date().getTime获取当前时间戳耗时比较
- System.currentTimeMillis,getTimeInMillis与new Date().getTime获取当前时间戳耗时比较
- Mysql get current time