Java Day of Week getDayOfWeekAsString(String sYear, String sMonth, String sDay)

Here you can find the source of getDayOfWeekAsString(String sYear, String sMonth, String sDay)

Description

get Day Of Week As String

License

Open Source License

Declaration

public static String getDayOfWeekAsString(String sYear, String sMonth, String sDay) 

Method Source Code

//package com.java2s;
/*/*  w  w w .  jav  a 2 s .c o  m*/
 * M2M ServiceFOTA ONM version 1.0
 *
 *  Copyright ? 2014 kt corp. All rights reserved.
 *
 *  This is a proprietary software of kt corp, and you may not use this file except in
 *  compliance with license agreement with kt corp. Any redistribution or use of this
 *  software, with or without modification shall be strictly prohibited without prior written
 *  approval of kt corp, and the copyright notice above does not evidence any actual or
 *  intended publication of such software.
 */

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;

public class Main {

    public static String getDayOfWeekAsString(String sYear, String sMonth, String sDay) {

        Calendar cd = new GregorianCalendar(Integer.parseInt(sYear), Integer.parseInt(sMonth) - 1,
                Integer.parseInt(sDay));

        SimpleDateFormat sdf = new SimpleDateFormat("EEE", Locale.KOREA); // "EEE" - Day in Week

        Date d1 = cd.getTime();

        return sdf.format(d1);
    }
}

Related

  1. getDayOfWeek(int year, int month, int day)
  2. getDayOfWeek(String date, String pattern)
  3. getDayOfWeek(String datetime)
  4. getDayOfWeek(String f)
  5. getDayOfWeek(String format, int calendarField)
  6. getDayofWeekByDay(String year, String month, String day)
  7. getDayofWeekForContainedDate(Date dt, DayOfWeek dow)
  8. getDaysByWeek(Integer month, Integer year, Integer week)
  9. getDaysByWeek2(Integer month, Integer year, Integer begin)