public class TimeUtil {
private Date date;
private String formate, apCharacter;
private SimpleDateFormat simpleDateFormate;
DateFormat formatter;
public TimeUtil(){
date = new Date();
formate = "HH:mm:ss a";
simpleDateFormate = new SimpleDateFormat(formate);
apCharacter = simpleDateFormate.format(date);
}
public TimeUtil(long time){
//formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
formatter = new SimpleDateFormat("hh:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
apCharacter=formatter.format(calendar.getTime());
}
public String getDate() {
return apCharacter;
}
}
--
Sunil Lakhiyani
+1 215 584 7289
On Tue, Feb 15, 2011 at 4:12 PM, TreKing <[email protected]> wrote:
> On Tue, Feb 15, 2011 at 4:46 AM, gaurav gupta
> <[email protected]>wrote:
>
>> m using Calender class ,but dont know how to find the proper result.
>
>
> Read the documentation for the Calendar class. Use the defined functions to
> set a date, then to advance one day at a time, and retrieve the day
> information as necessary.
>
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en