Exemple #1
0
        private string _getDateWithDateFormat(string format)
        {
            var timeStamp = TimeFormatter.GetUnixEpoch(DateTime.Now);
            var date      = NSDate.FromTimeIntervalSinceReferenceDate(timeStamp);

            var dateFormatter = new NSDateFormatter();

            dateFormatter.DateFormat = format;

            return(dateFormatter.ToString(date));
        }
        /// <summary>
        ///  Name -> GetStringTodayOfWeek
        ///  오늘에 대한 요일을 String형으로 리턴한다.
        /// </summary>
        /// <returns>NSString(일/월/화/수/목/금/토)</returns>
        public static string GetStringTodayOfWeek()
        {
            var _result = "";

            var selfObject = new TimeFormatter();

            switch (selfObject._getDayOfWeek())
            {
            case 1:
                _result = "일";
                break;

            case 2:
                _result = "월";
                break;

            case 3:
                _result = "화";
                break;

            case 4:
                _result = "수";
                break;

            case 5:
                _result = "목";
                break;

            case 6:
                _result = "금";
                break;

            case 7:
                _result = "토";
                break;

            default:
                break;
            }

            return(_result);
        }
        /// <summary>
        /// Name -> GetIntegerTodayOfWeek
        /// 오늘에 대한 요일을 int형으로 리턴한다.
        /// </summary>
        /// <returns>NSInteger(1:일요일/2:월요일/3:화요일/4:수요일/5:목요일/6:금요일/7:토요일)</returns>
        public static int GetIntegerTodayOfWeek()
        {
            var selfObject = new TimeFormatter();

            return(selfObject._getDayOfWeek());
        }
        public static string GetTodayWithDateFormat(string format)
        {
            var selfObject = new TimeFormatter();

            return(selfObject._getDateWithDateFormat(format));
        }
        public static string GetTodayYear()
        {
            var selfObject = new TimeFormatter();

            return(selfObject._getDateWithDateFormat("yyyy"));
        }