Example usage for java.util TimeZone getID

List of usage examples for java.util TimeZone getID

Introduction

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

Prototype

public String getID() 

Source Link

Document

Gets the ID of this time zone.

Usage

From source file:com.globalsight.webservices.Ambassador.java

/**
 * Get TimeZone by userId Note: web service API for Java.
 * /*from   w  w w . j  a  v a2  s  . c o  m*/
 * @throws WebServiceException
 */
public String getUserTimeZone(String p_accessToken, String p_userName) throws WebServiceException {
    checkAccess(p_accessToken, "getUserTimeZone");

    TimeZone timeZone = null;
    try {
        timeZone = ServerProxy.getCalendarManager().findUserTimeZone(UserUtil.getUserIdByName(p_userName));
    } catch (Exception e) {
        logger.error("Failed to get user time zone. ", e);
        timeZone = TimeZone.getDefault();
    }

    return timeZone.getID();
}