Java SQL Date Convert toCalender(final Date aDate)

Here you can find the source of toCalender(final Date aDate)

Description

to Calender

License

Apache License

Declaration

public static Calendar toCalender(final Date aDate) 

Method Source Code


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

import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static Calendar toCalender(final Date aDate) {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(aDate.getTime());
        return c;
    }//from   w w w .  j  av a 2s  . co  m

    public static Calendar toCalender(final java.sql.Date aDate) {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(aDate.getTime());
        return c;
    }

    public static Calendar toCalender(final Timestamp aTimestamp) {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(aTimestamp.getTime());
        return c;
    }
}

Related

  1. dateToString(java.util.Date date, String dateFmt)
  2. to2GMTString(final Date tsStart, final Date tsEnd)
  3. to_char(Date date, String format)
  4. to_char(Date date, String format)
  5. toBigDecimal(@Nullable final Date value)
  6. todaySqlDate()
  7. toDBDate(String str)
  8. toEnglishDate(String stringDate)
  9. toGMT(final Date ts)