خرید بک لینک

Vote count: 0

I have the following code in Java

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Test {
    public static void main(String[] args) {
        try {
            SimpleDateFormat SDF = new SimpleDateFormat("YYYY-MM-dd'T'HH:mm:ss");
            Calendar date = Calendar.getInstance();
            date.setTime(SDF.parse("2011-02-01T00:00:00"));
            System.out.println(SDF.format(date.getTime()));
        } catch (Exception e) {

        }
    }
}

I expect to see in the console the following string

2011-02-28T00:00:00

instead I see

2011-12-26T00:00:00

What can be wrong?

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 13 ارديبهشت 1395 ساعت: 17:21

صفحه بندی