All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.riversoft.weixin.common.util.DateDeserializer Maven / Gradle / Ivy

There is a newer version: 0.9.8
Show newest version
package com.riversoft.weixin.common.util;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

import java.io.IOException;
import java.util.Date;

/**
 * Created by exizhai on 11/18/2015.
 */
public class DateDeserializer extends JsonDeserializer {

    @Override
    public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
        //操蛋的微信,为啥不是毫秒
        long time = Long.valueOf(jsonParser.getText()) * 1000;
        return new Date(time);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy