C# Class NSoft.NFramework.Tools.DateTool

显示文件 Open project: debop/NFramework Class Usage Examples

Public Properties

Property Type Description
UnixEpoch System.DateTime

Public Methods

Method Description
Ago ( this from, System.DateTime date ) : System.DateTime

지정된 일자에 TimeSpan을 뺀 날자를 반환한다.

Combine ( this datePart, System.DateTime timePart ) : System.DateTime

Date Part와 TimePart를 합한다.

Days ( this days ) : System.TimeSpan

지정된 Day 만큼의 TimeSpan을 구한다.

From ( this from, System.DateTime date ) : System.DateTime

지정된 일자에 TimeSpan을 더한 날짜를 반환한다.

FromNow ( this from ) : System.DateTime

현재 날짜에 지정된 TimeSpan을 더한 날짜를 반환한다.

GetEndMonthOfQuarter ( this quarter ) : int

해당 분기의 마지막 월

GetEndOfCurrentMonth ( ) : System.DateTime

금월의 마지막 시각

GetEndOfCurrentQuarter ( ) : System.DateTime

현재 분기의 마지막 시각

GetEndOfCurrentWeek ( ) : System.DateTime

금주의 마지막 시각

GetEndOfCurrentYear ( ) : System.DateTime

이변년도의 마지막 일자

GetEndOfDay ( this date ) : System.DateTime

지정된 날짜의 마지막 시각

GetEndOfHalfYear ( this date ) : System.DateTime

반기의 마지막 일자를 구한다. N년 6월30일, N년 12월 31일

GetEndOfLastMonth ( ) : System.DateTime

전(前)월의 마지막 시각

GetEndOfLastWeek ( ) : System.DateTime

전(前) 주의 마지막 시각

GetEndOfLastYear ( ) : System.DateTime

전년도 마지막 시각

GetEndOfLastquarter ( ) : System.DateTime

전(前) 분기의 마지막 시각

GetEndOfMonth ( this date ) : System.DateTime

지정된 날짜가 속한 월의 마지막 시각

GetEndOfMonth ( this year, int month ) : System.DateTime

해당 년, 월의 마지막 시각

GetEndOfQuarter ( this quarter ) : System.DateTime

현재 년도의 지정된 분기의 마지막 시각 (3월 31일 23:59:59:999)

GetEndOfQuarter ( this quarter, int year ) : System.DateTime

해당년도의 해당 분기 마지막 시각 (3월 31일 23:59:59:999)

GetEndOfWeek ( this time ) : System.DateTime

지정된 날짜가 속한 주(week)의 마지막 날짜 (한국:토요일, ISO8601:일요일)

GetEndOfWeek ( this time, DayOfWeek firstDayOfWeek ) : System.DateTime

지정된 날짜가 속한 주(week)의 마지막 날짜 (한국:토요일, ISO8601:일요일)

GetEndOfYear ( this year ) : System.DateTime

지정된 년도의 마지막 시각

GetHalfYear ( this date ) : int

일자의 반기를 반환합니다. (전반기 : 1, 후반기 : 2)

GetLastQuarter ( ) : Quarters

현재 날짜 기준의 분기 바로 전의 분기를 구한다.

GetLastQuarter ( this date ) : Quarters

지정된 날짜의 분기의 앞의 분기를 구한다.

GetQuarter ( this month ) : Quarters

지정된 월이 속한 분기

GetStartMonthOfQuarter ( this quarter ) : int

해당 분기의 시작월

GetStartOfCurrentMonth ( ) : System.DateTime

금월의 시작 시각

GetStartOfCurrentQuarter ( ) : System.DateTime

현재 분기의 시작 시각

GetStartOfCurrentWeek ( ) : System.DateTime

금주의 시작 시각

GetStartOfCurrentYear ( ) : System.DateTime

이번 년도의 첫번째 일자

GetStartOfDay ( this date ) : System.DateTime

지정된 날짜의 시작 시각 (시간 파트가 0 이다.)

GetStartOfHalfYear ( this date ) : System.DateTime

반기의 시작일자를 구한다. N년 1월1일, N년 7월 1일

GetStartOfLastMonth ( ) : System.DateTime

전(前)월의 시작 시각

GetStartOfLastWeek ( ) : System.DateTime

전(前) 주(week)의 시작 시각

GetStartOfLastYear ( ) : System.DateTime

전년도 시작 시각

GetStartOfLastquarter ( ) : System.DateTime

전(前) 분기의 시작 시각

GetStartOfMonth ( this date ) : System.DateTime

지정된 일자가 속한 월의 시작일자

GetStartOfMonth ( this year, int month ) : System.DateTime

해당 년, 월의 시작 시각

GetStartOfQuarter ( this quarter ) : System.DateTime

현재 분기 첫번째 일자(DateTime

GetStartOfQuarter ( this quarter, int year ) : System.DateTime

해당 년도의 분기 첫번째 일자(DateTime

GetStartOfWeek ( this time ) : System.DateTime

지정된 날짜가 속한 주(week)의 첫번째 요일 (한국:일요일, ISO8601:월요일)의 날짜

GetStartOfWeek ( this time, DayOfWeek firstDayOfWeek ) : System.DateTime

지정된 날짜가 속한 주(week)의 첫번째 요일 (일요일)의 날짜

GetStartOfYear ( this year ) : System.DateTime

지정된 년도의 시작 시각

Hours ( this hours ) : System.TimeSpan

지정된 시간에 대한 TimeSpan

Milliseconds ( this milliseconds ) : System.TimeSpan

지정된 Millisecond 에 대한 TimeSpan

Minutes ( this minutes ) : System.TimeSpan

지정된 분에 대한 TimeSpan

NextDayOfWeek ( this current, DayOfWeek dow ) : System.DateTime

현재날짜로부터 가장 가까운 지정된 요일을 반환한다.

Noon ( this date ) : System.DateTime

지정된 날짜의 정오를 가르키는 시간을 만든다.

PrevDayOfWeek ( this current, DayOfWeek dow ) : System.DateTime

현재날짜로 지난 날짜 중에 가장 가까운 지정된 요일을 반환한다.

Seconds ( this seconds ) : System.TimeSpan

지정된 초에 대한 TimeSpan

SetDay ( this date, int day ) : System.DateTime

DateTime의 일만 지정된 일로 바꾼다.

SetHour ( this date, int hour ) : System.DateTime

날짜의 시간을 설정한다.

SetMillisecond ( this date, int millisecond ) : System.DateTime

날짜의 밀리초을 설정한다.

SetMinute ( this date, int minute ) : System.DateTime

날짜의 분을 설정한다.

SetMonth ( this date, int month ) : System.DateTime

DateTime의 월만 지정된 월로 바꾼다.

SetSecond ( this date, int second ) : System.DateTime

날짜의 초을 설정한다.

SetYear ( this date, int year ) : System.DateTime

DateTime의 년도를 지정된 값으로 설정한다.

Since ( this from, System.DateTime date ) : System.DateTime

지정된 일자에 TimeSpan을 더한 날짜를 반환한다. From과 같다.

ToDateTime ( this value ) : System.DateTime

DateTime 형식으로 변환한다. 실패시에는 new DateTime(0) 를 반환한다.

ToDateTime ( this value, System.DateTime defaultValue ) : System.DateTime

DateTime 형식으로 변환한다.

ToSqlPrecision ( this dt ) : System.DateTime

.NET DateTime 을 SQL Server DateTime 수형의 정밀도로 표현합니다. (SQL Server의 DateTime의 정밀도가 좀 낮다)

Weeks ( this weeks ) : System.TimeSpan

지정된 week 수만큼의 TimeSpan을 구한다.

Private Methods

Method Description
SetDate ( this date, int year ) : System.DateTime
SetDate ( this date, int year, int month ) : System.DateTime
SetDate ( this date, int year, int month, int day ) : System.DateTime
SetTime ( this date, int hour ) : System.DateTime
SetTime ( this date, int hour, int minute ) : System.DateTime
SetTime ( this date, int hour, int minute, int second ) : System.DateTime
SetTime ( this date, int hour, int minute, int second, int millisecond ) : System.DateTime

Method Details

Ago() public static method

지정된 일자에 TimeSpan을 뺀 날자를 반환한다.
public static Ago ( this from, System.DateTime date ) : System.DateTime
from this
date System.DateTime
return System.DateTime

Combine() public static method

Date Part와 TimePart를 합한다.
public static Combine ( this datePart, System.DateTime timePart ) : System.DateTime
datePart this Date 정보만
timePart System.DateTime Time 정보만
return System.DateTime

Days() public static method

지정된 Day 만큼의 TimeSpan을 구한다.
public static Days ( this days ) : System.TimeSpan
days this TimeSpan을 구할 Day값
return System.TimeSpan

From() public static method

지정된 일자에 TimeSpan을 더한 날짜를 반환한다.
public static From ( this from, System.DateTime date ) : System.DateTime
from this 더할 TimeSpan
date System.DateTime 대상 DateTime
return System.DateTime

FromNow() public static method

현재 날짜에 지정된 TimeSpan을 더한 날짜를 반환한다.
public static FromNow ( this from ) : System.DateTime
from this 더할 TimeSpan
return System.DateTime

GetEndMonthOfQuarter() public static method

해당 분기의 마지막 월
public static GetEndMonthOfQuarter ( this quarter ) : int
quarter this 해당 분기
return int

GetEndOfCurrentMonth() public static method

금월의 마지막 시각
public static GetEndOfCurrentMonth ( ) : System.DateTime
return System.DateTime

GetEndOfCurrentQuarter() public static method

현재 분기의 마지막 시각
public static GetEndOfCurrentQuarter ( ) : System.DateTime
return System.DateTime

GetEndOfCurrentWeek() public static method

금주의 마지막 시각
public static GetEndOfCurrentWeek ( ) : System.DateTime
return System.DateTime

GetEndOfCurrentYear() public static method

이변년도의 마지막 일자
public static GetEndOfCurrentYear ( ) : System.DateTime
return System.DateTime

GetEndOfDay() public static method

지정된 날짜의 마지막 시각
public static GetEndOfDay ( this date ) : System.DateTime
date this
return System.DateTime

GetEndOfHalfYear() public static method

반기의 마지막 일자를 구한다. N년 6월30일, N년 12월 31일
public static GetEndOfHalfYear ( this date ) : System.DateTime
date this
return System.DateTime

GetEndOfLastMonth() public static method

전(前)월의 마지막 시각
public static GetEndOfLastMonth ( ) : System.DateTime
return System.DateTime

GetEndOfLastWeek() public static method

전(前) 주의 마지막 시각
public static GetEndOfLastWeek ( ) : System.DateTime
return System.DateTime

GetEndOfLastYear() public static method

전년도 마지막 시각
public static GetEndOfLastYear ( ) : System.DateTime
return System.DateTime

GetEndOfLastquarter() public static method

전(前) 분기의 마지막 시각
public static GetEndOfLastquarter ( ) : System.DateTime
return System.DateTime

GetEndOfMonth() public static method

지정된 날짜가 속한 월의 마지막 시각
public static GetEndOfMonth ( this date ) : System.DateTime
date this
return System.DateTime

GetEndOfMonth() public static method

해당 년, 월의 마지막 시각
public static GetEndOfMonth ( this year, int month ) : System.DateTime
year this
month int
return System.DateTime

GetEndOfQuarter() public static method

현재 년도의 지정된 분기의 마지막 시각 (3월 31일 23:59:59:999)
public static GetEndOfQuarter ( this quarter ) : System.DateTime
quarter this quarter
return System.DateTime

GetEndOfQuarter() public static method

해당년도의 해당 분기 마지막 시각 (3월 31일 23:59:59:999)
public static GetEndOfQuarter ( this quarter, int year ) : System.DateTime
quarter this quarter
year int year
return System.DateTime

GetEndOfWeek() public static method

지정된 날짜가 속한 주(week)의 마지막 날짜 (한국:토요일, ISO8601:일요일)
public static GetEndOfWeek ( this time ) : System.DateTime
time this
return System.DateTime

GetEndOfWeek() public static method

지정된 날짜가 속한 주(week)의 마지막 날짜 (한국:토요일, ISO8601:일요일)
public static GetEndOfWeek ( this time, DayOfWeek firstDayOfWeek ) : System.DateTime
time this
firstDayOfWeek DayOfWeek 한 주의 첫번째 요일
return System.DateTime

GetEndOfYear() public static method

지정된 년도의 마지막 시각
public static GetEndOfYear ( this year ) : System.DateTime
year this
return System.DateTime

GetHalfYear() public static method

일자의 반기를 반환합니다. (전반기 : 1, 후반기 : 2)
public static GetHalfYear ( this date ) : int
date this
return int

GetLastQuarter() public static method

현재 날짜 기준의 분기 바로 전의 분기를 구한다.
public static GetLastQuarter ( ) : Quarters
return Quarters

GetLastQuarter() public static method

지정된 날짜의 분기의 앞의 분기를 구한다.
public static GetLastQuarter ( this date ) : Quarters
date this
return Quarters

GetQuarter() public static method

지정된 월이 속한 분기
public static GetQuarter ( this month ) : Quarters
month this 조회할 월
return Quarters

GetStartMonthOfQuarter() public static method

해당 분기의 시작월
public static GetStartMonthOfQuarter ( this quarter ) : int
quarter this 해당 분기
return int

GetStartOfCurrentMonth() public static method

금월의 시작 시각
public static GetStartOfCurrentMonth ( ) : System.DateTime
return System.DateTime

GetStartOfCurrentQuarter() public static method

현재 분기의 시작 시각
public static GetStartOfCurrentQuarter ( ) : System.DateTime
return System.DateTime

GetStartOfCurrentWeek() public static method

금주의 시작 시각
public static GetStartOfCurrentWeek ( ) : System.DateTime
return System.DateTime

GetStartOfCurrentYear() public static method

이번 년도의 첫번째 일자
public static GetStartOfCurrentYear ( ) : System.DateTime
return System.DateTime

GetStartOfDay() public static method

지정된 날짜의 시작 시각 (시간 파트가 0 이다.)
public static GetStartOfDay ( this date ) : System.DateTime
date this
return System.DateTime

GetStartOfHalfYear() public static method

반기의 시작일자를 구한다. N년 1월1일, N년 7월 1일
public static GetStartOfHalfYear ( this date ) : System.DateTime
date this
return System.DateTime

GetStartOfLastMonth() public static method

전(前)월의 시작 시각
public static GetStartOfLastMonth ( ) : System.DateTime
return System.DateTime

GetStartOfLastWeek() public static method

전(前) 주(week)의 시작 시각
public static GetStartOfLastWeek ( ) : System.DateTime
return System.DateTime

GetStartOfLastYear() public static method

전년도 시작 시각
public static GetStartOfLastYear ( ) : System.DateTime
return System.DateTime

GetStartOfLastquarter() public static method

전(前) 분기의 시작 시각
public static GetStartOfLastquarter ( ) : System.DateTime
return System.DateTime

GetStartOfMonth() public static method

지정된 일자가 속한 월의 시작일자
public static GetStartOfMonth ( this date ) : System.DateTime
date this
return System.DateTime

GetStartOfMonth() public static method

해당 년, 월의 시작 시각
public static GetStartOfMonth ( this year, int month ) : System.DateTime
year this
month int
return System.DateTime

GetStartOfQuarter() public static method

현재 분기 첫번째 일자(DateTime
public static GetStartOfQuarter ( this quarter ) : System.DateTime
quarter this 해당 분기
return System.DateTime

GetStartOfQuarter() public static method

해당 년도의 분기 첫번째 일자(DateTime
public static GetStartOfQuarter ( this quarter, int year ) : System.DateTime
quarter this 해당 분기
year int 해당 년도
return System.DateTime

GetStartOfWeek() public static method

지정된 날짜가 속한 주(week)의 첫번째 요일 (한국:일요일, ISO8601:월요일)의 날짜
public static GetStartOfWeek ( this time ) : System.DateTime
time this 일자
return System.DateTime

GetStartOfWeek() public static method

지정된 날짜가 속한 주(week)의 첫번째 요일 (일요일)의 날짜
public static GetStartOfWeek ( this time, DayOfWeek firstDayOfWeek ) : System.DateTime
time this 일자
firstDayOfWeek DayOfWeek 한 주의 첫번째 요일
return System.DateTime

GetStartOfYear() public static method

지정된 년도의 시작 시각
public static GetStartOfYear ( this year ) : System.DateTime
year this
return System.DateTime

Hours() public static method

지정된 시간에 대한 TimeSpan
public static Hours ( this hours ) : System.TimeSpan
hours this
return System.TimeSpan

Milliseconds() public static method

지정된 Millisecond 에 대한 TimeSpan
public static Milliseconds ( this milliseconds ) : System.TimeSpan
milliseconds this
return System.TimeSpan

Minutes() public static method

지정된 분에 대한 TimeSpan
public static Minutes ( this minutes ) : System.TimeSpan
minutes this
return System.TimeSpan

NextDayOfWeek() public static method

현재날짜로부터 가장 가까운 지정된 요일을 반환한다.
public static NextDayOfWeek ( this current, DayOfWeek dow ) : System.DateTime
current this
dow DayOfWeek
return System.DateTime

Noon() public static method

지정된 날짜의 정오를 가르키는 시간을 만든다.
public static Noon ( this date ) : System.DateTime
date this 기준 DateTime
return System.DateTime

PrevDayOfWeek() public static method

현재날짜로 지난 날짜 중에 가장 가까운 지정된 요일을 반환한다.
public static PrevDayOfWeek ( this current, DayOfWeek dow ) : System.DateTime
current this
dow DayOfWeek
return System.DateTime

Seconds() public static method

지정된 초에 대한 TimeSpan
public static Seconds ( this seconds ) : System.TimeSpan
seconds this
return System.TimeSpan

SetDay() public static method

DateTime의 일만 지정된 일로 바꾼다.
public static SetDay ( this date, int day ) : System.DateTime
date this
day int
return System.DateTime

SetHour() public static method

날짜의 시간을 설정한다.
public static SetHour ( this date, int hour ) : System.DateTime
date this 대상 DateTime
hour int
return System.DateTime

SetMillisecond() public static method

날짜의 밀리초을 설정한다.
public static SetMillisecond ( this date, int millisecond ) : System.DateTime
date this 대상 DateTime
millisecond int 밀리초
return System.DateTime

SetMinute() public static method

날짜의 분을 설정한다.
public static SetMinute ( this date, int minute ) : System.DateTime
date this 대상 DateTime
minute int
return System.DateTime

SetMonth() public static method

DateTime의 월만 지정된 월로 바꾼다.
public static SetMonth ( this date, int month ) : System.DateTime
date this
month int
return System.DateTime

SetSecond() public static method

날짜의 초을 설정한다.
public static SetSecond ( this date, int second ) : System.DateTime
date this 대상 DateTime
second int
return System.DateTime

SetYear() public static method

DateTime의 년도를 지정된 값으로 설정한다.
public static SetYear ( this date, int year ) : System.DateTime
date this
year int
return System.DateTime

Since() public static method

지정된 일자에 TimeSpan을 더한 날짜를 반환한다. From과 같다.
public static Since ( this from, System.DateTime date ) : System.DateTime
from this 더할 TimeSpan
date System.DateTime 대상 DateTime
return System.DateTime

ToDateTime() public static method

DateTime 형식으로 변환한다. 실패시에는 new DateTime(0) 를 반환한다.
public static ToDateTime ( this value ) : System.DateTime
value this 날짜를 나타내는 문자열
return System.DateTime

ToDateTime() public static method

DateTime 형식으로 변환한다.
public static ToDateTime ( this value, System.DateTime defaultValue ) : System.DateTime
value this 날짜를 나타내는 문자열
defaultValue System.DateTime 변환 실패시의 기본값
return System.DateTime

ToSqlPrecision() public static method

.NET DateTime 을 SQL Server DateTime 수형의 정밀도로 표현합니다. (SQL Server의 DateTime의 정밀도가 좀 낮다)
public static ToSqlPrecision ( this dt ) : System.DateTime
dt this
return System.DateTime

Weeks() public static method

지정된 week 수만큼의 TimeSpan을 구한다.
public static Weeks ( this weeks ) : System.TimeSpan
weeks this TimeSpan값을 구할 week 수
return System.TimeSpan

Property Details

UnixEpoch public_oe static_oe property

Timestamp 값이 1970-01-01 부터의 Tick 값을 표현한 것이다.
public static DateTime,System UnixEpoch
return System.DateTime