⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maildateformatter.java

📁 利用SyncML开发客户端程序的中间件
💻 JAVA
字号:
/*
 * Copyright (C) 2006-2007 Funambol
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package com.funambol.util;

import java.util.Calendar;
import java.util.Date;
import java.util.Hashtable;

/**
 * A utility class providing methods to convert date information contained in
 * <code>Date</code> objects into RFC2822 and UTC ('Zulu') strings, and to
 * build <code>Date</code> objects starting from string representations of
 * dates in RFC2822 and UTC format
 */
public class MailDateFormatter {
    
    /** Format date as: MM/DD */
    public static final int FORMAT_MONTH_DAY = 0;
    /** Format date as: MM/DD/YYYY */
    public static final int FORMAT_MONTH_DAY_YEAR = 1;
    /** Format date as: hh:mm */
    public static final int FORMAT_HOURS_MINUTES = 2;
    /** Format date as: hh:mm:ss */
    public static final int FORMAT_HOURS_MINUTES_SECONDS = 3;
    /** Format date as: DD/MM */
    public static final int FORMAT_DAY_MONTH = 4;
    /** Format date as: DD/MM/YYYY */
    public static final int FORMAT_DAY_MONTH_YEAR = 5;
    
    /** Device offset, as string */
    private static String deviceOffset = "+0000";
    /** Device offset, in millis */
    private static long millisDeviceOffset = 0;

    /** Names of the months */
    private static String[] monthNames = new String[] {
        "Jan", "Feb", "Mar", "Apr", "May", "Jun",
        "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
    };
     
    /**
     * Transforms data contained in a <code>Date</code> object (expressed in
     * UTC) in a string formatted as per RFC2822 in local time (

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -