Java Date UTC Parse utcToLocal(Date utcDate)

Here you can find the source of utcToLocal(Date utcDate)

Description

utc To Local

License

Open Source License

Declaration

protected static Date utcToLocal(Date utcDate) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    protected static Date utcToLocal(Date utcDate) {
        long utcMiliseconds = utcDate.getTime();

        Calendar cal = new GregorianCalendar();
        cal.setTimeInMillis(utcMiliseconds);
        return new Date(utcMiliseconds + cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET));
    }/*from   ww  w  .j  a  va  2 s  .  com*/
}

Related

  1. toUTC(Date date)
  2. toUTC(Date date)
  3. toUTC(Date date)
  4. uTCToChinaTS(Date date)
  5. UTCToDate(long utcValue)