亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? maildateformat.java

?? java Email you can use it to send email to others
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License").  You * may not use this file except in compliance with the License. You can obtain * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html * or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code.  If applicable, add the following below the License * Header, with the fields enclosed by brackets [] replaced by your own * identifying information: "Portions Copyrighted [year] * [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license."  If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above.  However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. *//* * @(#)MailDateFormat.java	1.17	07/05/04 */package javax.mail.internet;import java.util.Date;import java.util.Calendar;import java.util.GregorianCalendar;import java.util.Locale;import java.util.TimeZone;import java.text.DateFormat;import java.text.SimpleDateFormat;import java.text.NumberFormat;import java.text.FieldPosition;import java.text.ParsePosition;import java.text.ParseException;/** * Formats and parses date specification based on the * draft-ietf-drums-msg-fmt-08 dated January 26, 2000. This is a followup * spec to RFC822.<p> * * This class does not take pattern strings. It always formats the * date based on the specification below.<p> * * 3.3 Date and Time Specification<p> * * Date and time occur in several header fields of a message. This section * specifies the syntax for a full date and time specification. Though folding * whitespace is permitted throughout the date-time specification, it is * recommended that only a single space be used where FWS is required and no * space be used where FWS is optional in the date-time specification; some * older implementations may not interpret other occurrences of folding * whitespace correctly.<p> * * date-time = [ day-of-week "," ] date FWS time [CFWS]<p> * * day-of-week = ([FWS] day-name) / obs-day-of-week<p> * * day-name = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"<p> * * date = day month year<p> * * year = 4*DIGIT / obs-year<p> * * month = (FWS month-name FWS) / obs-month<p> * *<pre>month-name = "Jan" / "Feb" / "Mar" / "Apr" / *             "May" / "Jun" / "Jul" / "Aug" / *             "Sep" / "Oct" / "Nov" / "Dec" * </pre><p> * day = ([FWS] 1*2DIGIT) / obs-day<p> * * time = time-of-day FWS zone<p> * * time-of-day = hour ":" minute [ ":" second ]<p> * * hour = 2DIGIT / obs-hour<p> * * minute = 2DIGIT / obs-minute<p> * * second = 2DIGIT / obs-second<p> * * zone = (( "+" / "-" ) 4DIGIT) / obs-zone<p> * * * The day is the numeric day of the month. The year is any numeric year in * the common era.<p> * * The time-of-day specifies the number of hours, minutes, and optionally * seconds since midnight of the date indicated.<p> * * The date and time-of-day SHOULD express local time.<p> * * The zone specifies the offset from Coordinated Universal Time (UTC, * formerly referred to as "Greenwich Mean Time") that the date and * time-of-day represent. The "+" or "-" indicates whether the time-of-day is * ahead of or behind Universal Time. The first two digits indicate the number * of hours difference from Universal Time, and the last two digits indicate * the number of minutes difference from Universal Time. (Hence, +hhmm means * +(hh * 60 + mm) minutes, and -hhmm means -(hh * 60 + mm) minutes). The form * "+0000" SHOULD be used to indicate a time zone at Universal Time. Though * "-0000" also indicates Universal Time, it is used to indicate that the time * was generated on a system that may be in a local time zone other than * Universal Time.<p> * * A date-time specification MUST be semantically valid. That is, the * day-of-the week (if included) MUST be the day implied by the date, the * numeric day-of-month MUST be between 1 and the number of days allowed for * the specified month (in the specified year), the time-of-day MUST be in the * range 00:00:00 through 23:59:60 (the number of seconds allowing for a leap * second; see [STD-12]), and the zone MUST be within the range -9959 through * +9959.<p> * * @author Max Spivak * @since		JavaMail 1.2 */public class MailDateFormat extends SimpleDateFormat {    private static final long serialVersionUID = -8148227605210628779L;    public MailDateFormat() {	super("EEE, d MMM yyyy HH:mm:ss 'XXXXX' (z)", Locale.US);    }    /**     * Formats the given date in the format specified by      * draft-ietf-drums-msg-fmt-08 in the current TimeZone.     *     * @param   date            the Date object     * @param   dateStrBuf      the formatted string     * @param   fieldPosition   the current field position     * @return	StringBuffer    the formatted String     * @since			JavaMail 1.2     */    public StringBuffer format(Date date, StringBuffer dateStrBuf,			       FieldPosition fieldPosition) {	/* How this method works: First format the date with the	 * format specified in the constructor inserting string 'XXXXX' 	 * where the timezone offset goes. Find where in the string the	 * string 'XXXXX' appears and remember that in var "pos". 	 * Calculate the offset, taking the DST into account and insert	 * it into the stringbuffer at position pos.	 */	int start = dateStrBuf.length();	super.format(date, dateStrBuf, fieldPosition);	int pos = 0;	// find the beginning of the 'XXXXX' string in the formatted date	// 25 is the first position that we expect to find XXXXX at	for (pos = start + 25; dateStrBuf.charAt(pos) != 'X'; pos++)	    ;	// set the timezone to +HHMM or -HHMM	calendar.clear();	calendar.setTime(date);	int offset = calendar.get(Calendar.ZONE_OFFSET) +			calendar.get(Calendar.DST_OFFSET);	// take care of the sign	if (offset < 0) {	    dateStrBuf.setCharAt(pos++, '-');	    offset = (-offset);	} else	    dateStrBuf.setCharAt(pos++, '+');	int rawOffsetInMins = offset / 60 / 1000; // offset from GMT in mins 	int offsetInHrs = rawOffsetInMins / 60;	int offsetInMins = rawOffsetInMins % 60;	dateStrBuf.setCharAt(pos++, Character.forDigit((offsetInHrs/10), 10));	dateStrBuf.setCharAt(pos++, Character.forDigit((offsetInHrs%10), 10));	dateStrBuf.setCharAt(pos++, Character.forDigit((offsetInMins/10), 10));	dateStrBuf.setCharAt(pos++, Character.forDigit((offsetInMins%10), 10));	// done with timezone		return dateStrBuf;    }    ////////////////////////////////////////////////////////////    /**     * Parses the given date in the format specified by     * draft-ietf-drums-msg-fmt-08 in the current TimeZone.     *     * @param   text    the formatted date to be parsed     * @param   pos     the current parse position     * @return	Date    the parsed date in a Date object     * @since		JavaMail 1.2     */    public Date parse(String text, ParsePosition pos) {	return parseDate(text.toCharArray(), pos, isLenient());    }    /*      Valid Examples:            Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST)      Date:       Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST)      Date:     26 Aug 76 14:29 EDT      */        /**     * method of what to look for:     *     *     *	skip WS     *	skip day ","  	(this is "Mon", "Tue")     *	skip WS     *     *	parse number (until WS) ==> 1*2DIGIT (day of month)     *     *	skip WS     *     *	parse alpha chars (until WS) ==> find month     *     *	skip WS     *     *	parse number (until WS) ==> 2*4DIGIT (year)     *     *	skip WS     *     *	// now looking for time     *	parse number (until ':') ==> hours     *	parse number (until ':') ==> minutes     *	parse number (until WS) ==> seconds     *     *	// now look for Time Zone     *	skip WS     *	if ('+' or '-') then numerical time zone offset     *  if (alpha) then alpha time zone offset     */    static boolean debug = false;    /**     * create a Date by parsing the char array     */    static private Date parseDate(char[] orig, ParsePosition pos,				boolean lenient) {	try {	    int day = -1;	    int month = -1;	    int year = -1;	    int hours = 0;	    int minutes = 0;	    int seconds = 0;	    int offset = 0;						    MailDateParser p = new MailDateParser(orig);				    // get the day	    p.skipUntilNumber();	    day = p.parseNumber();	    if (!p.skipIfChar('-')) {  // for IMAP internal Date		p.skipWhiteSpace();	    }	    // get the month			    month = p.parseMonth();	    if (!p.skipIfChar('-')) {  // for IMAP internal Date		p.skipWhiteSpace();	    }	    	    // get the year	    year = p.parseNumber();	// should not return a negative number	    if (year < 50) {		year += 2000;	    } else if (year < 100) {		year += 1900;	    } // otherwise the year is correct (and should be 4 digits)							    // get the time	    // first get hours	    p.skipWhiteSpace();	    hours = p.parseNumber();				    // get minutes	    p.skipChar(':');	    minutes = p.parseNumber();	    	    // get seconds  (may be no seconds)	    if (p.skipIfChar(':')) {		seconds = p.parseNumber();	    }	    				    // try to get a Time Zone	    try {		p.skipWhiteSpace();		offset = p.parseTimeZone();	    } catch (ParseException pe) {		if (debug) {		    System.out.println("No timezone? : '" +						new String(orig) + "'");		}	    }				    pos.setIndex(p.getIndex());	    Date d = ourUTC(year, month, day, hours, minutes, seconds, offset,							lenient);	    return d;	} catch (Exception e) {	    // Catch *all* exceptions, including RuntimeExceptions like	    // ArrayIndexOutofBoundsException ... we need to be	    // extra tolerant of all those bogus dates that might screw	    // up our parser. Sigh.	    if (debug) {		System.out.println("Bad date: '" + new String(orig) + "'");		e.printStackTrace();	    }	    pos.setIndex(1); // to prevent DateFormat.parse() from throwing ex	    return null;	}    }	    private static TimeZone tz = TimeZone.getTimeZone("GMT");    private static Calendar cal = new GregorianCalendar(tz);    private synchronized static Date ourUTC(int year, int mon, int mday,					   int hour, int min, int sec,					   int tzoffset, boolean lenient) {	// clear the time and then set all the values	cal.clear();	cal.setLenient(lenient);	cal.set(Calendar.YEAR, year);	cal.set(Calendar.MONTH, mon);	cal.set(Calendar.DATE, mday);	cal.set(Calendar.HOUR_OF_DAY, hour);	cal.set(Calendar.MINUTE, min + tzoffset);  // adjusted for the timezone	cal.set(Calendar.SECOND, sec);	return cal.getTime();    }	    ////////////////////////////////////////////////////////////        /** Don't allow setting the calendar */    public void setCalendar(Calendar newCalendar) {	throw new RuntimeException("Method setCalendar() shouldn't be called");    }    /** Don't allow setting the NumberFormat */    public void setNumberFormat(NumberFormat newNumberFormat) {	throw new RuntimeException("Method setNumberFormat() shouldn't be called");    }        /* test code for MailDateFormat */    /*    public static void main(String[] args) {	DateFormat df = new MailDateFormat();	Date d = new Date();	// test output in all the timezones	System.out.println("------- test all timezones  ---------------");	System.out.println("Current date: " + d);	String[] allIDs = TimeZone.getAvailableIDs();	for (int i = 0; i < allIDs.length; i++) {	    TimeZone tz = TimeZone.getTimeZone(allIDs[i]);	    df.setTimeZone(tz);	    System.out.println("Date in " + tz.getID() + ":    " +			       df.format(new Date()));	}	try {        System.out.println(df.parse("Sun, 21 Mar 1993 23:56:48 -0800 (PST)"));	System.out.println(df.parse("Mon, 22 Mar 1994 13:34:51 +0000"));	System.out.println(df.parse("26 Aug 76 14:29 EDT"));	System.out.println(df.parse("15 Apr 11 23:49 EST"));	System.out.println(df.parse("15 Apr 11 23:49 ABC"));	} catch (ParseException pex) {	    pex.printStackTrace();	}	// reset DateFormat TZ	df.setTimeZone(TimeZone.getDefault());	// test all days in a month	System.out.println();	System.out.println("------- test all days in a month ---------------");	Calendar cal = Calendar.getInstance();	cal.set(Calendar.YEAR, 1972);	cal.set(Calendar.MONTH, Calendar.OCTOBER);	cal.set(Calendar.DATE, 1);	cal.set(Calendar.HOUR, 10);	cal.set(Calendar.MINUTE, 50);	cal.set(Calendar.AM_PM, Calendar.PM);	System.out.println("Initial Date: " + cal.getTime());	System.out.println("Current Date: " + df.format(cal.getTime()));	for (int i = 0; i < 30; i++) {	    cal.roll(Calendar.DATE, true);	    System.out.println("Current Date: " + df.format(cal.getTime()));	}	// test all months	System.out.println();	System.out.println("------- test all months in a year -----------");	cal.set(Calendar.MONTH, Calendar.JANUARY);	cal.set(Calendar.DATE, 7);	System.out.println("Initial Date: " + cal.getTime());	System.out.println("Current Date: " + df.format(cal.getTime()));	for (int i = 1; i < 12; i++) {	    cal.roll(Calendar.MONTH, true);	    System.out.println("Current Date: " + df.format(cal.getTime()));	}	// test leap years	System.out.println();	System.out.println("------- test leap years -----------");	cal.set(Calendar.YEAR, 1999);	cal.set(Calendar.MONTH, Calendar.JANUARY);	cal.set(Calendar.DATE, 31);	cal.roll(Calendar.MONTH, true);	System.out.println("Initial Date: " + cal.getTime());	System.out.println("Current Date: " + df.format(cal.getTime()));	for (int i = 1; i < 12; i++) {	    cal.set(Calendar.MONTH, Calendar.JANUARY);	    cal.set(Calendar.DATE, 31);	    cal.roll(Calendar.YEAR, true);	    cal.roll(Calendar.MONTH, true);	    System.out.println("Current Date: " + df.format(cal.getTime()));	}    }    */}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品亚洲一区| 亚洲一区视频在线观看视频| 久久电影网电视剧免费观看| 精品欧美久久久| 美国十次了思思久久精品导航| 日韩精品一区二区三区在线观看| 国产一区二区免费在线| 久久久久国色av免费看影院| voyeur盗摄精品| 亚洲一区二区在线视频| 日韩一区二区免费在线观看| 国产一区二区伦理| 亚洲三级电影网站| 欧美日本一区二区三区四区| 人人爽香蕉精品| 国产精品嫩草久久久久| 色综合天天综合网天天看片| 丝袜美腿亚洲一区| 国产亚洲欧美在线| 一本色道亚洲精品aⅴ| 午夜精品久久久久久久蜜桃app| 精品国产a毛片| 成人va在线观看| 天天色天天爱天天射综合| 久久日韩精品一区二区五区| 色综合久久中文综合久久97| 日韩国产在线观看一区| 亚洲精品在线一区二区| 色婷婷综合中文久久一本| 日韩国产在线观看一区| 国产精品丝袜一区| 这里只有精品99re| 99国产精品久| 久久精品国产一区二区| 亚洲免费大片在线观看| 久久精品综合网| 91精品国产91综合久久蜜臀| 成人黄色在线视频| 精品系列免费在线观看| 伊人开心综合网| 久久精品人人做人人综合| 欧美色大人视频| 成人一区在线观看| 极品瑜伽女神91| 亚洲成人中文在线| 1区2区3区欧美| 欧美激情在线看| 日韩精品一区二区三区视频播放 | 欧美国产激情一区二区三区蜜月| 欧美色图第一页| 9人人澡人人爽人人精品| 美女视频黄a大片欧美| 亚洲国产精品久久久久婷婷884| 国产精品家庭影院| 国产日产欧美一区二区三区 | 精品国产一区二区三区久久久蜜月| 色欲综合视频天天天| 国产成人精品免费在线| 激情综合网av| 日本三级韩国三级欧美三级| 亚洲第一精品在线| 亚洲视频在线观看三级| 欧美激情中文字幕一区二区| 久久蜜臀中文字幕| 精品久久久久av影院| 欧美成人r级一区二区三区| 欧美裸体一区二区三区| 欧美美女喷水视频| 欧美日韩国产a| 欧美日韩国产欧美日美国产精品| 色狠狠色狠狠综合| 色八戒一区二区三区| 一本久道中文字幕精品亚洲嫩| 91无套直看片红桃| 91久久人澡人人添人人爽欧美| 91丨九色porny丨蝌蚪| 91网页版在线| 91福利视频在线| 欧美少妇一区二区| 欧美疯狂性受xxxxx喷水图片| 88在线观看91蜜桃国自产| 91.com视频| 精品少妇一区二区三区在线播放 | 亚洲综合一区二区三区| 伊人婷婷欧美激情| 性做久久久久久免费观看| 亚洲成在人线免费| 免费久久精品视频| 国产精品一区二区视频| 成人高清视频在线| 91毛片在线观看| 欧美图区在线视频| 日韩欧美国产高清| 欧美国产在线观看| 亚洲欧美乱综合| 亚洲国产日韩一级| 久久国产视频网| 丁香婷婷深情五月亚洲| 91社区在线播放| 欧美日韩精品一二三区| 精品国产免费视频| 国产精品不卡在线| 午夜av电影一区| 国产精品资源网站| 在线一区二区视频| 欧美videos中文字幕| 国产亚洲欧美中文| 亚洲在线免费播放| 久久99久久精品| www.66久久| 日韩一区二区三区在线视频| 久久久久久久综合日本| 亚洲激情图片一区| 久草在线在线精品观看| 91日韩精品一区| 日韩美一区二区三区| 亚洲同性gay激情无套| 三级影片在线观看欧美日韩一区二区| 精品在线你懂的| 一本久道久久综合中文字幕| 日韩美女天天操| 日韩一区日韩二区| 久久精品理论片| 色综合天天综合网天天狠天天| 欧美一区二区三区视频在线| 欧美激情一二三区| 免费成人在线影院| 色哟哟一区二区| 久久精品人人爽人人爽| 午夜免费久久看| 99久久婷婷国产精品综合| 91精品国产综合久久蜜臀| 亚洲人妖av一区二区| 国内成人自拍视频| 在线播放中文一区| 亚洲免费在线观看| 高清国产一区二区| 欧美变态tickling挠脚心| 亚洲国产aⅴ成人精品无吗| av一二三不卡影片| 久久影院午夜片一区| 日韩影院免费视频| 欧美亚洲动漫制服丝袜| 1区2区3区欧美| 成人小视频在线观看| 精品久久一区二区| 日本欧美久久久久免费播放网| 一本大道久久a久久精二百| 国产日韩精品一区二区三区| 卡一卡二国产精品 | 日韩一区精品视频| 欧美性猛交一区二区三区精品| 中文字幕高清一区| 国产成人精品免费一区二区| 精品国产乱码久久久久久久| 日韩avvvv在线播放| 欧美日韩精品专区| 一级特黄大欧美久久久| 9l国产精品久久久久麻豆| 中文字幕av一区二区三区免费看| 国产精品69毛片高清亚洲| 日韩免费高清av| 麻豆国产一区二区| 日韩欧美一区二区免费| 美女脱光内衣内裤视频久久网站 | 97久久超碰精品国产| 国产日韩欧美制服另类| 国产老肥熟一区二区三区| 欧美精品一区二区久久婷婷| 免费高清不卡av| 日韩精品专区在线影院重磅| 久久精品国内一区二区三区| 日韩精品自拍偷拍| 国内精品免费**视频| 久久久久久久免费视频了| 国产综合成人久久大片91| 国产日本亚洲高清| 成人h动漫精品一区二区| 亚洲欧洲成人自拍| 91首页免费视频| 亚洲va欧美va人人爽| 欧美一级国产精品| 国内精品伊人久久久久av一坑 | 奇米888四色在线精品| 日韩欧美在线1卡| 国产伦精一区二区三区| 国产亚洲欧美色| 色哟哟一区二区三区| 午夜国产精品影院在线观看| 91精品一区二区三区久久久久久| 久久电影网电视剧免费观看| 国产视频一区二区在线观看| 9i看片成人免费高清| 亚洲成人av福利| 2020国产精品| 色综合天天综合网国产成人综合天| 亚洲主播在线播放| 日韩欧美aaaaaa| 成人av电影在线播放| 天天影视涩香欲综合网|