DateTimeFormatter 클래스

정의

날짜 및 시간 형식을 지정합니다.

public ref class DateTimeFormatter sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.DateTimeFormatting.IDateTimeFormatterFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DateTimeFormatter final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.DateTimeFormatting.IDateTimeFormatterFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class DateTimeFormatter final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.DateTimeFormatting.IDateTimeFormatterFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DateTimeFormatter
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.DateTimeFormatting.IDateTimeFormatterFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class DateTimeFormatter
function DateTimeFormatter(yearFormat, monthFormat, dayFormat, dayOfWeekFormat, hourFormat, minuteFormat, secondFormat, languages, geographicRegion, calendar, clock)
Public NotInheritable Class DateTimeFormatter
상속
Object Platform::Object IInspectable DateTimeFormatter
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

DateTimeFormatter 클래스를 사용하여 날짜 서식을 지정합니다.

// Format a date via a string template. Note that the order specifed in the string pattern does
// not determine the order of the parts of the formatted string. The user's language and region
// preferences will determine the pattern of the date returned based on the specified parts.

var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter("month day dayofweek year");
DateTime dateToFormat = DateTime.Now;
var mydate = formatter.Format(dateToFormat);

패턴 문법다음 문법은 패턴에 허용되는 항목을 정의합니다.

<pattern> ::= [<literal-text>] <datetime-pattern> [<literal-text>] |
              [<literal-text>] <datetime-pattern> <pattern>

<literal-text> ::= <literal-character>+

<literal-character> ::= [^{}] | "{openbrace}" | "{closebrace}"

<datetime-pattern> ::= <date-pattern> | <time-pattern>

<date-pattern> ::= <era> | <year> | <month> | <day> | <dayofweek>

<time-pattern> ::= <period> | <hour> | <minute> | <second> | <timezone>

<era> ::= "{era.abbreviated" [<ideal-length>] "}"

<year> ::= "{year.full" [<ideal-length>] "}" |
           "{year.abbreviated" [<ideal-length>] "}"

<month> ::= "{month.full}" |
            "{month.solo.full}" |
            "{month.abbreviated" [<ideal-length>] "}"
            "{month.solo.abbreviated" [<ideal-length>] "}"
            "{month.integer" [<ideal-length>] "}"

<dayofweek> ::= "{dayofweek.full}" |
                "{dayofweek.solo.full}" |
                "{dayofweek.abbreviated" [<ideal-length>] "}"
                "{dayofweek.solo.abbreviated" [<ideal-length>] "}"

<day> ::= "{day.integer" [<ideal-length>] "}"

<period> ::= "{period.abbreviated" [<ideal-length>] "}"

<hour> ::= "{hour.integer" [<ideal-length>] "}"

<minute> ::= "{minute.integer" [<ideal-length>] "}"

<second> ::= "{second.integer" [<ideal-length>] "}"

<timezone> ::= "{timezone.full}" |
                "{timezone.abbreviated" [<ideal-length>] "}"

<ideal-length> ::= "(" <non-zero-digit> ")"

<non-zero-digit> ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

템플릿 문법다음 문법은 템플릿에 허용되는 항목을 정의합니다.

<template> ::= <opt-whitespace> <date> <opt-whitespace> |
               <opt-whitespace> <time> <opt-whitespace> |
               <opt-whitespace> <specific-date> <whitespace> <time> <opt-whitespace> |
               <opt-whitespace> <time> <whitespace> <specific-date> <opt-whitespace> |
               <opt-whitespace> <relative-date> <whitespace> <time> <opt-whitespace> |
               <opt-whitespace> <time> <whitespace> <relative-date> <opt-whitespace>

<opt-whitespace> ::= [<whitespace>] 

<whitespace> ::= " "+ 

<date> ::= <year> | <month> | <day> | <month-year> | <relative-date> | <specific-date>

<relativedate> ::= <dayofweek> | <month-day> | <relative-longdate>

<specificdate> ::= <shortdate> | <longdate>

<month-day> ::= <month> <whitespace> <day> |
                <day> <whitespace> <month>

<relative-longdate> ::= <month> <whitespace> <day> <whitespace> <dayofweek> |
                        <month> <whitespace> <dayofweek> <whitespace> <day> |
                        <day> <whitespace> <month> <whitespace> <dayofweek> |
                        <day> <whitespace> <dayofweek> <whitespace> <month> |
                        <dayofweek> <whitespace> <day> <whitespace> <month> |
                        <dayofweek> <whitespace> <month> <whitespace> <day>

<month-year> ::= <month> <whitespace> <year> |
                 <year> <whitespace> <month>


<shortdate> ::= "shortdate" |
                <month> <whitespace> <day> <whitespace> <year> |
                <month> <whitespace> <year> <whitespace> <day> |
                <day> <whitespace> <month> <whitespace> <year> |
                <day> <whitespace> <year> <whitespace> <month> |
                <year> <whitespace> <day> <whitespace> <month> |
                <year> <whitespace> <month> <whitespace> <day>


<longdate> ::= "longdate" |
               <year> <whitespace> <month> <whitespace> <day> <whitespace> <dayofweek> |
               <year> <whitespace> <month> <whitespace> <dayofweek> <whitespace> <day> |
               <year> <whitespace> <day> <whitespace> <month> <whitespace> <dayofweek> |
               <year> <whitespace> <day> <whitespace> <dayofweek> <whitespace> <month> |
               <year> <whitespace> <dayofweek> <whitespace> <day> <whitespace> <month> |
               <year> <whitespace> <dayofweek> <whitespace> <month> <whitespace> <day> |
               <month> <whitespace> <year> <whitespace> <day> <whitespace> <dayofweek> |
               <month> <whitespace> <year> <whitespace> <dayofweek> <whitespace> <day> |
               <day> <whitespace> <year> <whitespace> <month> <whitespace> <dayofweek> |
               <day> <whitespace> <year> <whitespace> <dayofweek> <whitespace> <month> |
               <dayofweek> <whitespace> <year> <whitespace> <day> <whitespace> <month> |
               <dayofweek> <whitespace> <year> <whitespace> <month> <whitespace> <day> |
               <month> <whitespace> <day> <whitespace> <year> <whitespace> <dayofweek> |
               <month> <whitespace> <dayofweek> <whitespace> <year> <whitespace> <day> |
               <day> <whitespace> <month> <whitespace> <year> <whitespace> <dayofweek> |
               <day> <whitespace> <dayofweek> <whitespace> <year> <whitespace> <month> |
               <dayofweek> <whitespace> <day> <whitespace> <year> <whitespace> <month> |
               <dayofweek> <whitespace> <month> <whitespace> <year> <whitespace> <day> |
               <month> <whitespace> <day> <whitespace> <dayofweek> <whitespace> <year> |
               <month> <whitespace> <dayofweek> <whitespace> <day> <whitespace> <year> |
               <day> <whitespace> <month> <whitespace> <dayofweek> <whitespace> <year> |
               <day> <whitespace> <dayofweek> <whitespace> <month> <whitespace> <year> |
               <dayofweek> <whitespace> <day> <whitespace> <month> <whitespace> <year> |
               <dayofweek> <whitespace> <month> <whitespace> <day> <whitespace> <year>

<time> ::= <hour> | 
           <hour> <whitespace> <timezone> |
           <timezone> <whitespace> <hour> |
           <shorttime> |
           <longtime>

<shorttime> ::= "shorttime" |
                <hour> <whitespace> <minute> |
                <minute> <whitespace> <hour> |
                <timezone> <whitespace> <hour> <whitespace> <minute> |
                <timezone> <whitespace> <minute> <whitespace> <hour> |
                <hour> <whitespace> <timezone> <whitespace> <minute> |
                <minute> <whitespace> <timezone> <whitespace> <hour> |
                <hour> <whitespace> <minute> <whitespace> <timezone> |
                <minute> <whitespace> <hour> <whitespace> <timezone>

<longtime> ::= "longtime" |
               <hour> <whitespace> <minute> <whitespace> <second> |
               <hour> <whitespace> <second> <whitespace> <minute> |
               <minute> <whitespace> <hour> <whitespace> <second> |
               <minute> <whitespace> <second> <whitespace> <hour> |
               <second> <whitespace> <minute> <whitespace> <hour> |
               <second> <whitespace> <hour> <whitespace> <minute> |
               <timezone> <whitespace> <hour> <whitespace> <minute> <whitespace> <second> |
               <timezone> <whitespace> <hour> <whitespace> <second> <whitespace> <minute> |
               <timezone> <whitespace> <minute> <whitespace> <hour> <whitespace> <second> |
               <timezone> <whitespace> <minute> <whitespace> <second> <whitespace> <hour> |
               <timezone> <whitespace> <second> <whitespace> <minute> <whitespace> <hour> |
               <timezone> <whitespace> <second> <whitespace> <hour> <whitespace> <minute> |
               <hour> <whitespace> <timezone> <whitespace> <minute> <whitespace> <second> |
               <hour> <whitespace> <timezone> <whitespace> <second> <whitespace> <minute> |
               <minute> <whitespace> <timezone> <whitespace> <hour> <whitespace> <second> |
               <minute> <whitespace> <timezone> <whitespace> <second> <whitespace> <hour> |
               <second> <whitespace> <timezone> <whitespace> <minute> <whitespace> <hour> |
               <second> <whitespace> <timezone> <whitespace> <hour> <whitespace> <minute> |
               <hour> <whitespace> <minute> <whitespace> <timezone> <whitespace> <second> |
               <hour> <whitespace> <second> <whitespace> <timezone> <whitespace> <minute> |
               <minute> <whitespace> <hour> <whitespace> <timezone> <whitespace> <second> |
               <minute> <whitespace> <second> <whitespace> <timezone> <whitespace> <hour> |
               <second> <whitespace> <minute> <whitespace> <timezone> <whitespace> <hour> |
               <second> <whitespace> <hour> <whitespace> <timezone> <whitespace> <minute> |
               <hour> <whitespace> <minute> <whitespace> <second> <whitespace> <timezone> |
               <hour> <whitespace> <second> <whitespace> <minute> <whitespace> <timezone> |
               <minute> <whitespace> <hour> <whitespace> <second> <whitespace> <timezone> |
               <minute> <whitespace> <second> <whitespace> <hour> <whitespace> <timezone> |
               <second> <whitespace> <minute> <whitespace> <hour> <whitespace> <timezone> |
               <second> <whitespace> <hour> <whitespace> <minute> <whitespace> <timezone>

<year> ::= "year" | "year.full" | "year.abbreviated"

<month> ::= "month" | "month.full" | "month.abbreviated" | "month.numeric"

<day> ::= "day"

<dayofweek> ::= "dayofweek" | "dayofweek.full" | "dayofweek.abbreviated"

<hour> ::= "hour"

<minute> ::= "minute"

<second> ::= "second"

<timezone> ::= "timezone" | "timezone.full" | "timezone.abbreviated"

설명

참고

이 API는 2019년 5월 일본 시대 변경을 지원하기 위해 업데이트되고 있습니다. 애플리케이션에서 일본어 달력을 지원하는 경우 새 시대를 제대로 처리하고 있는지 확인해야 합니다. 자세한 내용은 일본 시대 변경을 위한 애플리케이션 준비를 참조하세요 .

참고

앱이 이 클래스에 사용된 언어 태그를 모든 국가 언어 지원 함수에 전달하는 경우 먼저 ResolveLocaleName을 호출하여 태그를 변환해야 합니다.

DateTimeFormatter의 생성자 중 일부는 서식을 지정할 요청된 구성 요소를 지정하는 formatTemplate 문자열 매개 변수를 사용합니다. 이 매개 변수는 서식 템플릿 또는 형식 패턴일 수 있습니다. 서식 서식 파일은 사용자가 지정한 언어, 클록 및 달력에 일반적인 서식을 사용하고 제공하는 데 편리합니다. 서식 패턴은 서식 서식 파일보다 출력을 더 많이 제어할 수 있습니다. 표준이 아닌 서식이 필요한 경우 템플릿 대신 서식 패턴을 사용합니다.

서식 템플릿에서 서식이 지정된 출력에 포함할 구성 요소(시간, 날짜, 요일 등)를 지정합니다. 포맷터는 지정된 언어, 클록 및 달력에 맞게 구성 요소의 형식을 지정합니다. 템플릿의 구성 요소 순서는 중요하지 않습니다. 포맷터는 아래 서식 서식 파일 언어에 표시된 순서에 따라 구성 요소를 정렬합니다.

일반적으로 사용되는 일부 템플릿은 다음 표에 나와 있습니다. 둘 이상의 구성 요소가 있는 템플릿에서 구성 요소는 지원되는 구성 요소 변형 중 하나일 수 있으며 구성 요소는 순서에 따라 다를 수 있습니다. 예를 들어 "dayofweek.full year month.numeric day"가 지원됩니다. 유효한 템플릿을 정의하는 문법은 아래 예제를 참조하세요.

중요

구성 요소를 임의로 결합할 수 없으며 반드시 유효한 템플릿을 가져올 수 없습니다. 유일하게 유효한 템플릿은 제공된 문법으로 정의된 템플릿입니다.

템플릿
longdate
shortdate
오랜
shorttime
dayofweek
dayofweek.full
dayofweek.abbreviated
month
month.full
month.abbreviated
month.numeric
year
year.full
year.abbreviated
dayofweek day month year
dayofweek day month
일 월 연도
일 월
월 연도
hour
minute
second
시간 분 초
시간 분
timezone
timezone.full
timezone.abbreviated
연도 월 일 시간

다음 표에서는 템플릿, 언어 및 클록의 다양한 값으로 만든 포맷터의 샘플 출력을 보여 줍니다. "해당 패턴" 열은 템플릿과 동일한 출력을 생성하는 패턴을 제공합니다.

템플릿Language시계출력동등한 패턴
longdateen-US<지정되지 않음>2013년 9월 2일 월요일{dayofweek.full}, {month.full} {day.integer}, {year.full}
longdatefr-FR<지정되지 않음>lundi 2 septembre 2013{dayofweek.full} {day.integer} {month.full} {year.full}
shortdateen-US<지정되지 않음>9‎/‎2‎/‎2013{month.integer}/{day.integer}/{year.full}
shortdatefr-FR<지정되지 않음>02‎/‎09‎/‎2013{day.integer(2)}/{month.integer(2)}/{year.full}
dayofweek 월 일en-US<지정되지 않음>9월 2일 월요일{dayofweek.full}, {month.full} {day.integer}
month dayofweeken-US<지정되지 않음>9월 2일 월요일{dayofweek.full}, {month.full} {day.integer}
오랜en-US<지정되지 않음>오전 6:01:24{hour.integer}:{minute.integer(2)}:{second.integer(2)} {period.abbreviated}
오랜en-US24HourClock‎17‎:‎32‎:‎45{hour.integer}:{minute.integer(2)}:{second.integer(2)}
오랜fr-FR<지정되지 않음>17‎:‎32‎:‎45{hour.integer(2)}:{minute.integer(2)}:{second.integer(2)}
shorttimeen-US<지정되지 않음>오전 6:01{hour.integer}:{minute.integer(2)} {period.abbreviated}
shorttimeen-US24HourClock17‎:‎32{hour.integer}:{minute.integer(2)}
shorttimefr-FR<지정되지 않음>17‎:‎32{hour.integer(2)}:{minute.integer(2)}

형식 패턴은 "{day.numeric}/{month.numeric}/{year.full}"과 같이 중괄호로 구분된 필드가 있는 리터럴 문자열로 구성됩니다. 일반적으로 사용되는 일부 필드는 다음 표에 나열되어 있습니다. 유효한 패턴을 정의하는 문법은 예제 다음에 있는 아래를 참조하세요.

중요

필드를 임의로 결합할 수 없으며 반드시 유효한 패턴을 얻을 수 없습니다. 유일하게 유효한 패턴은 제공된 문법으로 정의된 패턴입니다.

서식 패턴 필드
{openbrace}
{closebrace}
{dayofweek.solo.<type>} 여기서 <형식> 이 full/abbreviated/abbreviated(n)
{dayofweek.<type>} 여기서 <형식> 이 full/abbreviated/abbreviated(n)
{day.<type>} 여기서 <type> 은 정수/정수(n)
{month.<type>} 여기서 <type> 이 full/abbreviated/abbreviated(n) / integer/integer(n)
{month.solo.<type>} 여기서 <형식> 이 full/abbreviated/abbreviated(n)
{year.<type>} 여기서 <형식> 이 full/abbreviated/abbreviated(n)
{era.<type>} 여기서 <형식> 이 full/abbreviated/abbreviated(n)
{hour.<type>} 여기서 <type> 은 정수/정수(n)
{period.<type>} 여기서 <형식> 이 full/abbreviated/abbreviated(n)
{minute.<type>} 여기서 <type> 은 정수/정수(n)
{second.<type>} 여기서 <type> 은 정수/정수(n)
{표준 시간대.<type>} 여기서 <형식> 이 full/abbreviated/abbreviated(n)

참고

  • {openbrace} 또는 {closebrace}를 사용하여 "{" 또는 "}"가 리터럴 문자열의 일부로 표시되도록 지정합니다.
  • solo 는 독립 실행형 형식을 지정합니다. Genitive 대/소문자를 구분하는 언어의 경우 genitive 사례는 표시되지 않은 사례입니다. 지명 사례를 얻으려면 솔로를 사용합니다.
  • 월의 다섯 번째 날에 대한 정수(2)는 "05"이고 정수(1)는 "5"를 생성합니다. 정수 는 지정된 언어/달력 조합에 가장 적합한 n 을 생성합니다.
  • 년 동안 전체 는 모든 숫자를 생성합니다("2013"). 약어는 약어 (2)와 동의어이며, 이는 그레고리력의 2자리 연도("13")입니다. (다른 일정은 결국 다른 것을 기본값으로 사용할 수 있습니다. 지정된 언어/달력 조합에 가장 적합한 의미 체계를 갖도록 약어를 유지했습니다.) abbreviated(n) 는 가장 중요한 n 자리로 잘립니다(예: n =1이 "3"인 2013).

다음 표에서는 패턴, 언어 및 클록의 다양한 값으로 만든 포맷터의 샘플 출력을 보여 줍니다.

패턴언어시계출력
{dayofweek.full}, {month.full} {day.integer}, {year.full}en-US<지정되지 않음>2013년 9월 2일 월요일
{dayofweek.full}, {day.integer(2)} {month.full}, {year.full}fr-FR<지정되지 않음>lundi, 02 septembre, 2013
{month.integer}/{day.integer}/{year.full}en-US<지정되지 않음>9/‎2/2013
{month.integer}/{day.integer}/{year.abbreviated}en-US<지정되지 않음>9/‎2/13
{month.integer(2)}/{day.integer(2)}/{year.abbreviated}en-US<지정되지 않음>09/‎02/13
{hour.integer}:{minute.integer(2)}:{second.integer(2)} {period.abbreviated}en-US<지정되지 않음>오전 6:01:24
{hour.integer}:{minute.integer(2)}:{second.integer(2)} {period.abbreviated}en-US24HourClock17:32:45

생성자

DateTimeFormatter(HourFormat, MinuteFormat, SecondFormat)

시간, 분 및 두 번째 형식으로 초기화되는 DateTimeFormatter 개체를 만듭니다.

DateTimeFormatter(String)

서식 템플릿 문자열로 초기화되는 DateTimeFormatter 개체를 만듭니다.

DateTimeFormatter(String, IIterable<String>)

서식 템플릿 문자열 및 언어 목록으로 초기화되는 DateTimeFormatter 개체를 만듭니다.

DateTimeFormatter(String, IIterable<String>, String, String, String)

서식 서식 파일 문자열, 언어 목록, 지리적 지역, 달력 및 클록으로 초기화되는 DateTimeFormatter 개체를 만듭니다.

DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat)

연도, 월, 일 및 요일 형식으로 초기화된 DateTimeFormatter 개체를 만듭니다.

DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>)

연도, 월, 일, 요일, 시간, 분 및 두 번째 형식 및 언어 목록으로 초기화되는 DateTimeFormatter 개체를 만듭니다.

DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>, String, String, String)

모든 형식과 식별자가 지정된 DateTimeFormatter 개체를 만듭니다.

속성

Calendar

날짜 서식을 지정할 때 사용되는 달력을 가져옵니다.

Clock

시간을 포맷할 때 사용되는 클록을 가져옵니다.

GeographicRegion

날짜 및 시간의 서식을 지정할 때 사용되는 지역을 가져오거나 설정합니다.

IncludeDay

템플릿에서 DayFormat 을 가져옵니다.

IncludeDayOfWeek

템플릿에서 DayOfWeekFormat 을 가져옵니다.

IncludeHour

템플릿에서 HourFormat 을 가져옵니다.

IncludeMinute

템플릿에서 MinuteFormat 을 가져옵니다.

IncludeMonth

템플릿에서 MonthFormat 을 가져옵니다.

IncludeSecond

템플릿에서 SecondFormat 을 가져옵니다.

IncludeYear

템플릿에서 YearFormat 을 가져옵니다.

Languages

날짜 및 시간의 서식을 지정할 때 사용되는 언어 식별자의 우선 순위 목록을 가져옵니다.

LongDate

사용자가 선택한 긴 날짜 패턴에 따라 날짜 서식을 지정하는 DateTimeFormatter 개체를 가져옵니다.

LongTime

사용자가 선택한 장시간 패턴에 따라 시간을 포맷하는 DateTimeFormatter 개체를 가져옵니다.

NumeralSystem

날짜 및 시간의 서식을 지정하는 데 사용되는 번호 매기기 시스템을 가져오거나 설정합니다.

Patterns

날짜 및 시간을 서식 지정할 때 사용되는 이 템플릿에 해당하는 패턴을 가져옵니다.

ResolvedGeographicRegion

날짜 및 시간의 서식을 지정하는 데 가장 최근에 사용된 지리적 지역을 가져옵니다.

ResolvedLanguage

날짜 및 시간의 서식을 지정하는 데 가장 최근에 사용된 언어를 가져옵니다.

ShortDate

사용자가 선택한 짧은 날짜 패턴에 따라 날짜 서식을 지정하는 DateTimeFormatter 개체를 가져옵니다.

ShortTime

사용자가 선택한 짧은 시간 패턴에 따라 시간을 포맷하는 DateTimeFormatter 개체를 가져옵니다.

Template

이 서식 서식 파일의 문자열 표현을 가져옵니다.

메서드

Format(DateTime)

제공된 날짜 및 시간의 문자열 표현을 반환합니다.

Format(DateTime, String)

지정된 표준 시간대의 지정된 날짜 및 시간을 나타내는 문자열을 반환하며 포맷터가 현재 사용하고 있는 템플릿을 준수합니다.

적용 대상

추가 정보