Here you can find the source of getTimeLocalWithoutDst(java.util.Date d)
Parameter | Description |
---|---|
d | the date |
public static long getTimeLocalWithoutDst(java.util.Date d)
//package com.java2s; /*/*w w w .java2s . c om*/ * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (http://h2database.com/html/license.html). * Initial Developer: H2 Group * Iso8601: * Initial Developer: Robert Rathsack (firstName dot lastName at gmx dot de) */ import java.util.Calendar; public class Main { private static final ThreadLocal<Calendar> CACHED_CALENDAR = new ThreadLocal<Calendar>() { @Override protected Calendar initialValue() { return Calendar.getInstance(); } }; /** * Get the number of milliseconds since 1970-01-01 in the local timezone, * but without daylight saving time into account. * * @param d the date * @return the milliseconds */ public static long getTimeLocalWithoutDst(java.util.Date d) { return d.getTime() + CACHED_CALENDAR.get().get(Calendar.ZONE_OFFSET); } }