Code example for SimpleTimeZone

0
     * is used. 
     */ 
    public Time( 
        Date    date)
    { 
        SimpleTimeZone      tz = new SimpleTimeZone(0, "Z");
        SimpleDateFormat    dateF = new SimpleDateFormat("yyyyMMddHHmmss");
 
        dateF.setTimeZone(tz);
 
        String  d = dateF.format(date) + "Z";
        int     year = Integer.parseInt(d.substring(0, 4));
 
        if (year < 1950 || year > 2049)
        { 
            time = new DERGeneralizedTime(d);
        } 
        else 
        { 
            time = new DERUTCTime(d.substring(2));
        }