Example usage for com.google.gwt.i18n.shared TimeZone getRFCTimeZoneString

List of usage examples for com.google.gwt.i18n.shared TimeZone getRFCTimeZoneString

Introduction

In this page you can find the example usage for com.google.gwt.i18n.shared TimeZone getRFCTimeZoneString.

Prototype

String getRFCTimeZoneString(Date date);

Source Link

Document

To get RFC representation of certain time zone name for given date.

Usage

From source file:com.rnb.plategka.shared.DateTimeFormat.java

License:Apache License

/**
 * Formats Timezone field following RFC.
 * //from  ww w.  ja v  a 2 s  . com
 * @param buf
 *            where formatted string will be appended to
 * @param count
 *            number of time pattern char repeats; this controls how a field
 *            should be formatted
 * @param date
 *            hold the date object to be formatted
 */
private void formatTimeZoneRFC(StringBuffer buf, int count, Date date, TimeZone timeZone) {
    if (count < 3) {
        buf.append(timeZone.getRFCTimeZoneString(date));
    } else if (count == 3) {
        buf.append(timeZone.getISOTimeZoneString(date));
    } else {
        buf.append(timeZone.getGMTString(date));
    }
}

From source file:org.ssgwt.share.i18n.DateTimeFormat.java

License:Apache License

/**
 * Formats Timezone field following RFC.
 *
 * @param buf where formatted string will be appended to
 * @param count number of time pattern char repeats; this controls how a field
 *          should be formatted//from ww w .  j av  a2 s.  c om
 * @param date hold the date object to be formatted
 */
private void formatTimeZoneRFC(StringBuffer buf, int count, SSDate date, TimeZone timeZone) {
    if (count < 3) {
        buf.append(timeZone.getRFCTimeZoneString(date));
    } else if (count == 3) {
        buf.append(timeZone.getISOTimeZoneString(date));
    } else {
        buf.append(timeZone.getGMTString(date));
    }
}