시간/숫자
ISO 8601 기간 파서
"P3Y6M4DT12H30M5S"와 같은 문자열을 읽기 쉬운 형태로 분석하거나, 년/월/일/시/분/초로 이런 문자열을 생성합니다.
빈 필드 = 0; 값이 0인 필드는 문자열에 포함되지 않습니다. 주 구성요소(P4W)는 분석 시에만 지원됩니다 — 생성 시에는 일을 사용하세요.
An ISO 8601 duration (e.g. P3Y6M4DT12H30M5S) is a compact, unambiguous way to write a time span, used by many APIs and data formats, but hard to read without parsing it. This tool translates such a string into plain language and lets you build one from separate fields.
How to use it
- Parse: paste an ISO duration string to get years, months, days, hours, minutes, and seconds broken out separately, in a readable form.
- Build: enter the duration components you need and the tool assembles a valid ISO 8601 string.
- The letter T before the time part (hours/minutes/seconds) is required and gets added automatically when needed.
Common uses
- Reading a duration field from an API response (a subscription, a rental period, a timeout) given in this format.
- Building a correctly formatted ISO 8601 string for a request that expects a duration in exactly this format.
- Debugging why a third-party API's parser rejects a hand-built duration — checking it against the standard's exact syntax.
Things to keep in mind
The leading P stands for "period" and is required, just like the T that separates days from hours in the time part.
The base standard doesn't define a sign for durations — negative durations (to mean "ago") are only supported by specific implementations as an unofficial extension.
자주 묻는 질문
P3Y6M4DT12H30M5S 같은 문자열은 무엇을 의미하나요?
이것은 표준 ISO 8601 기간 형식입니다: P는 "period"(기간)를 의미하며, 그 뒤에 T 문자까지 년/월/일이 오고, 그 후에 시/분/초가 옵니다. 이 예시에서는 3년, 6개월, 4일, 12시간, 30분, 5초입니다.
ISO 기간은 시간 단위의 단순한 기간과 어떻게 다른가요?
기간 계산기처럼 고정 단위와 달리, 여기서 "년"과 "월" 구성 요소는 달력 기반이며 고정된 초 수를 가지지 않습니다 — 정확한 길이는 적용되는 특정 날짜에 따라 달라집니다.
주 형식 P4W가 지원되나요?
예, 하지만 기존 문자열을 파싱할 때만 해당됩니다. 자신만의 문자열을 만들 때는 ISO 8601이 한 문자열에서 주를 다른 구성 요소와 결합하는 것을 허용하지 않으므로 주는 일 단위로 표현해야 합니다.
소수 초나 소수 분을 지정할 수 있나요?
예, 표준은 문자열의 마지막 구성요소에만 소수 부분을 허용합니다 — 예를 들어 PT1.5S(1.5초)나 PT1H30.5M(1시간 30.5분)은 유효하지만, 마지막이 아닌 구성요소의 소수 부분은 유효하지 않습니다.
음수 ISO 기간도 있나요?
기본 ISO 8601 표준은 기간의 부호를 정의하지 않지만, 일부 구현체(이 도구 포함)는 "이전" 또는 반대 방향 기간을 나타내기 위해 앞에 마이너스 부호를 붙이는 것을 지원합니다 — 이는 널리 쓰이지만 비공식적인 확장입니다.