Package com.ibm.icu.text

Examples of com.ibm.icu.text.SimpleDateFormat.format()


                // to create a currency
                break;
            case ID_TIMEZONE:
                SimpleDateFormat dtf = new SimpleDateFormat("vvvv",locale);
                dtf.setTimeZone(TimeZone.getFrozenTimeZone(id));
                result = dtf.format(new Date());
                // TODO, have method that doesn't require us to create a timezone
                // fix other hacks
                // hack for couldn't match
               
                boolean isBadStr = false;
View Full Code Here


        }
    }

    public String convertToString(Object value, Locale locale, Convertor.FormatCache formatCache) {
        SimpleDateFormat dateFormat = getDateFormat(locale, formatCache);
        return dateFormat.format((Date)value);
    }

    private final SimpleDateFormat getDateFormat(Locale locale, Convertor.FormatCache formatCache) {
        SimpleDateFormat dateFormat = null;
        if (formatCache != null)
View Full Code Here

        }
    }

    public String convertToString(Object value, Locale locale, Convertor.FormatCache formatCache) {
        SimpleDateFormat dateFormat = getDateFormat(locale, formatCache);
        return dateFormat.format((Date)value);
    }

    private final SimpleDateFormat getDateFormat(Locale locale, Convertor.FormatCache formatCache) {
        SimpleDateFormat dateFormat = null;
        if (formatCache != null)
View Full Code Here

                // to create a currency
                break;
            case ID_TIMEZONE:
                SimpleDateFormat dtf = new SimpleDateFormat("vvvv",locale);
                dtf.setTimeZone(TimeZone.getTimeZone(id));
                result = dtf.format(new Date());
                // TODO, have method that doesn't require us to create a timezone
                // fix other hacks
                // hack for couldn't match
               
                boolean isBadStr = false;
View Full Code Here

                // to create a currency
                break;
            case ID_TIMEZONE:
                SimpleDateFormat dtf = new SimpleDateFormat("vvvv",locale);
                dtf.setTimeZone(TimeZone.getTimeZone(id));
                result = dtf.format(new Date());
                // TODO, have method that doesn't require us to create a timezone
                // fix other hacks
                // hack for couldn't match
               
                boolean isBadStr = false;
View Full Code Here

        format.setTimeZone(this);
        Date d = new Date();
        if (style >= 2) {
            // Generic names may change time to time even for a single time zone.
            // This method returns the one used for the zone now.
            return format.format(d);
        } else {
            int[] offsets = new int[2];
            getOffset(d.getTime(), false, offsets);
            if ((daylight && offsets[1] != 0) || (!daylight && offsets[1] == 0)) {
                return format.format(d);
View Full Code Here

            return format.format(d);
        } else {
            int[] offsets = new int[2];
            getOffset(d.getTime(), false, offsets);
            if ((daylight && offsets[1] != 0) || (!daylight && offsets[1] == 0)) {
                return format.format(d);
            }

            // Create a new SimpleTimeZone as a stand-in for this zone; the stand-in
            // will have no DST, or DST during July, but the same ID and offset,
            // and hence the same display name.  We don't cache these because
View Full Code Here

            } else {
                // The display name for standard time was requested, but currently in DST
                tz = new SimpleTimeZone(offsets[0], getID());
                format.setTimeZone(tz);
            }
            return format.format(d);
        }
    }

    /**
     * Returns the amount of time to be added to local standard time
View Full Code Here

                // to create a currency
                break;
            case ID_TIMEZONE:
                SimpleDateFormat dtf = new SimpleDateFormat("vvvv",locale);
                dtf.setTimeZone(TimeZone.getTimeZone(id));
                result = dtf.format(new Date());
                // TODO, have method that doesn't require us to create a timezone
                // fix other hacks
                // hack for couldn't match
                // note, compiling with FOUNDATION omits this check for now
//#ifndef FOUNDATION
View Full Code Here

        String[] patterns = { "z", "zzzz", "v", "vvvv" };
        format.applyPattern(patterns[style]);     
        format.setTimeZone(tz);
        // Format a date in January.  We use the value 10*ONE_DAY == Jan 11 1970
        // 0:00 GMT.
        return format.format(new Date(864000000L));
    }

    /**
     * Returns the amount of time to be added to local standard time
     * to get local wall clock time.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.