yy1717
2020-05-15 76859aa4b23ea8ebd90bd7553fd70e144bdc96ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.safeluck.aykj.decoder;
 
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
 
/**
 * Created by zw on 2017/6/15.
 */
 
public class BcdDateTimeCoder extends BaseDecoder<Date>  {
    SimpleDateFormat f= new SimpleDateFormat("yyMMddHHmmss");
    @Override
    public Date decode(String date) {
        try {
            return f.parse(date);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }
 
    @Override
    public String encode(Date date) {
        return f.format(date);
    }
}