Android应用上显示的时间提前1小时

时间:2015-03-31 03:44:01

标签: android

我有一个Android应用程序,它使用后端Web服务在设备之间发送和接收消息。

问题:应用程序的收件箱和已发送邮箱中显示的邮件时间提前1小时(例如,如果实时是上午8:00,应用程序显示上午9:00)请帮忙。这是我的代码:

private static class DateTime {
    static final char HOUR_OF_DAY_0 = 'H'; // (00 - 23)
    static final char HOUR_0        = 'I'; // (01 - 12)
    static final char HOUR_OF_DAY   = 'k'; // (0 - 23) -- like H
    static final char HOUR          = 'l'; // (1 - 12) -- like I
    static final char MINUTE        = 'M'; // (00 - 59)
    static final char NANOSECOND    = 'N'; // (000000000 - 999999999)
    static final char MILLISECOND   = 'L'; // jdk, not in gnu (000 - 999)
    static final char MILLISECOND_SINCE_EPOCH = 'Q'; // (0 - 99...?)
    static final char AM_PM         = 'p'; // (am or pm)
    static final char SECONDS_SINCE_EPOCH = 's'; // (0 - 99...?)
    static final char SECOND        = 'S'; // (00 - 60 - leap second)
    static final char TIME          = 'T'; // (24 hour hh:mm:ss)
    static final char ZONE_NUMERIC  = 'z'; // (-1200 - +1200) - ls minus?
    static final char ZONE          = 'Z'; // (symbol)

    // Composites
    static final char TIME_12_HOUR  = 'r'; // (hh:mm:ss [AP]M)
    static final char TIME_24_HOUR  = 'R'; // (hh:mm same as %H:%M)
    // *    static final char LOCALE_TIME   = 'X'; // (%H:%M:%S) - parse format?
    static final char DATE_TIME             = 'c';
                                        // (Sat Nov 04 12:02:33 EST 1999)
    static final char DATE                  = 'D'; // (mm/dd/yy)
    static final char ISO_STANDARD_DATE     = 'F'; // (%Y-%m-%d)
    // *    static final char LOCALE_DATE           = 'x'; // (mm/dd/yy)

更多信息:

public class Inbox {

    private String messageID;
    private String from;
    private List<String> to;
    private String subject;
    private String voice_file;
    private String datetime;
    private String is_read;

    public String getMessageID(){
        return messageID;
    }

    public void setMessageID(String messageID){
        this.messageID= messageID;
    }

    public String getFrom(){
        return from;
    }

    public void setFrom(String from){
        this.from= from;
    }

    public String getSubject(){
        return subject;
    }

    public void setSubject(String subject){
        this.subject= subject;
    }

    public String getVoiceFile(){
        return voice_file;
    }

    public void setVoiceFile(String voice_file){
        this.voice_file= voice_file;
    }

    public String getDateTime(){
        return datetime;
    }

    public void setDateTime(String datetime){
        this.datetime= datetime;
    }

    public List<String> getTo(){
        return this.to;
    }

    public void setTo(List<String> to){
        this.to= to;
    }

    public String getIsRead(){
        return is_read;
    }

    public void setIsRead(String is_read){
        this.is_read= is_read;
    }

}

public class Sentbox {

    private String messageID;
    private String from;
    private List<String> toName;
    private List<String> to;
    private String subject;
    private String voice_file;
    private String datetime;

    public String getMessageID(){
        return messageID;
    }

    public void setMessageID(String messageID){
        this.messageID= messageID;
    }

    public String getFrom(){
        return from;
    }

    public void setFrom(String from){
        this.from= from;
    }

    public String getSubject(){
        return subject;
    }

    public void setSubject(String subject){
        this.subject= subject;
    }

    public String getVoiceFile(){
        return voice_file;
    }

    public void setVoiceFile(String voice_file){
        this.voice_file= voice_file;
    }

    public String getDateTime(){
        return datetime;
    }

    public void setDateTime(String datetime){
        this.datetime= datetime;
    }

    public List<String> getTo(){
        return this.to;
    }

    public void setTo(List<String> to){
        this.to= to;
    }

    public List<String> getToName(){
        return this.toName;
    }

    public void setToName(List<String> toName){
        this.toName= toName;
    }

}

0 个答案:

没有答案