How to convert System.DateTime to JAva.Util.Calendar

What is the syntax for this conversion?

Answers

  • rraallvvrraallvv Member ✭✭

    +1

  • rraallvvrraallvv Member ✭✭
    public static Calendar ConvertToCalendar(DateTime date) 
    {
        Calendar calendar = Calendar.Instance;
        calendar.Set(date.Year, date.Month - 1, date.Day, date.Hour, date.Minute, date.Second);
        return calendar;
    } 
    
Sign In or Register to comment.