Example usage for java.util TimeZone getDefault

List of usage examples for java.util TimeZone getDefault

Introduction

In this page you can find the example usage for java.util TimeZone getDefault.

Prototype

public static TimeZone getDefault() 

Source Link

Document

Gets the default TimeZone of the Java virtual machine.

Usage

From source file:bentolor.grocerylist.persistence.ModelSerializer.java

public ModelSerializer() {
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
    mapper = new ObjectMapper();
    mapper.setDateFormat(df);/*from  w ww  .  j  a  v a2  s . c  o m*/
    mapper.setTimeZone(TimeZone.getDefault());
    mapper.enable(SerializationFeature.INDENT_OUTPUT);
}

From source file:persistence.DefaultModelSerializer.java

@Start(order = 90)
public void configureObjectMapper() {
    mapper.setDateFormat(df);
    mapper.setTimeZone(TimeZone.getDefault());
    mapper.enable(SerializationFeature.INDENT_OUTPUT);
}

From source file:jp.xet.baseunits.spring.StringTimePointGenericConverter.java

/**
 * ??
 */
public StringTimePointGenericConverter() {
    this(DEFAULT_FORMAT, TimeZone.getDefault());
}

From source file:com.dianxin.imessage.common.util.DateUtil.java

public static String getLocalTimeFromUTC(Date UTCDate) {
    format.setTimeZone(TimeZone.getDefault());
    return format.format(UTCDate);
}

From source file:com.pureinfo.srm.project.ProjectToFinishRemindJob.java

private static Date getNMonthLater(int _n) {
    Calendar cal = Calendar.getInstance();
    cal.setTimeZone(TimeZone.getDefault());
    cal.roll(Calendar.MONTH, _n);
    return cal.getTime();
}

From source file:com.redhat.rhn.frontend.graphing.test.GraphGeneratorTest.java

/**
 * {@inheritDoc}//from  w w w .j  a v a  2 s . c o m
 */
protected void setUp() throws Exception {
    super.setUp();
    Context ctx = Context.getCurrentContext();
    ctx.setTimezone(TimeZone.getDefault());
    ctx.setLocale(Locale.getDefault());

}

From source file:com.triage.sqlgoat.tests.TestBytemanScaffold.java

@Test(expectedExceptions = RuntimeException.class)
@BMScript(value = "scaffoldbasictest", dir = "target/test-classes/btmrules")
public void testBytemanRuleFromFile() {
    String name = TimeZone.getDefault().getDisplayName();
}

From source file:io.github.sparta.helpers.date.DateUtil.java

/**
 * convert user date to new date with server side Locale.
 * /*from  ww w  .j  ava 2  s . c om*/
 * @param userTimeZone
 *            user TimeZone id
 * @param userDate
 *            date in user's Local
 * @return serverDate data in server's Local
 */
public static Date convertToServerDate(String userTimeZone, Date userDate) {
    TimeZone userLocal = TimeZone.getTimeZone(userTimeZone);
    int rawOffset = TimeZone.getDefault().getRawOffset() - userLocal.getRawOffset();
    return new Date(userDate.getTime() + rawOffset);
}

From source file:DateUtility.java

/**
 * Returns a primitive long which represents the timestamp of the first millisecond
 * of the month matching the supplied parameters.  This method assumes the
 * default timezone./*w ww  . j a v  a2 s .c o m*/
 * @param year
 * @param month
 * @return long
 */
static public long getFirstMilliOfMonth(String year, String month) {
    return getFirstMilliOfMonth(year, month, TimeZone.getDefault());
}

From source file:charva.awt.util.DateEntryField.java

public DateEntryField(Frame owner_) {
    this(owner_, TimeZone.getDefault());
}