Android Long to Date Convert toCalendar(long hour)

Here you can find the source of toCalendar(long hour)

Description

to Calendar

License

LGPL

Declaration

static public Calendar toCalendar(long hour) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.Calendar;

public class Main {
    static public Calendar toCalendar(long hour) {
        Calendar calNow = Calendar.getInstance();
        Calendar calSet = (Calendar) calNow.clone();

        calSet.set(Calendar.HOUR_OF_DAY, calNow.get(Calendar.HOUR_OF_DAY));
        calSet.set(Calendar.MINUTE, calNow.get(Calendar.MINUTE));
        calSet.set(Calendar.SECOND, calNow.get(Calendar.SECOND) + 3);
        calSet.set(Calendar.MILLISECOND, 0);

        return calSet;
    }/*from   w ww .j a va  2  s .  c o m*/
}

Related

  1. timestampToDate(long timeStamp)
  2. timestampToDate(long timeStamp)
  3. timestampToISO8601(long aTime)
  4. timestampToIso8601Str(long timestamp)
  5. timestampToIso8601Str(long timestamp)
  6. toDateString(long seconds)
  7. toFullDate(long timestamp)
  8. toIso8601(long date, boolean utc)
  9. toJulianDay(long epochMillis)