데이터 유형 data-types

기술적으로, 상수는 항상 데이터 형식을 포함합니다. 리터럴 표현식에서는 값만 지정합니다. 값(예: 문자열, 정수, 십진수 등)에서 데이터 형식을 유추할 수 있습니다. 날짜 시간과 같은 특정한 경우에, 우리는 표현에 전용 함수를 사용한다.

아래 섹션에서는 다양한 데이터 유형 표현식과 표현식을 표시하는 방법에 대한 정보를 제공합니다.

문자열 string

설명

일반적인 문자 시퀀스. 사용 가능한 메모리 양과 같은 환경에서 발생하는 암시적 크기 외에는 특정 크기가 없습니다.

JSON 형식: 문자열

직렬화 형식: UTF-8

리터럴 표시

"<value>"
'<value>'

예

"hello world"
'hello world'

정수 integer

설명

-2^63부터 2^63-1까지의 정수 값입니다.

JSON 형식: 숫자

리터럴 표시

<integer value>

예

42

decimal decimal

설명

10진수입니다. 부동 값을 나타냅니다.

  • double 유형의 가장 큰 양의 유한 값, (2-2-52)x21023
  • double 유형의 가장 작은 양의 정규 값, 2-1022
  • double, 2 p-1074 유형의 가장 작은 양수 nonzero 값

JSON 형식: 숫자

직렬화 형식: 소수점 구분 기호로 '.'를 사용합니다.

리터럴 표시

<integer value>.<integer value>

예

3.14

부울 boolean

설명

소문자로 작성된 부울 값: true 또는 false

JSON 형식: 부울

리터럴 표시

true
false

예

true

dateOnly date-only

설명

표준 시간대 없이 1년 1개월로 표시된 날짜만 나타냅니다.

생일에 사용되는 날짜에 대한 설명입니다.

JSON 형식: 문자열.

형식은 YYYY-MM-DD(ISO-8601)입니다(예: “2021-03-11”).

toDateOnly 함수에 캡슐화할 수 있습니다.

DateTimeFormatter ISO_LOCAL_DATE_TIME을 사용하여 값을 deserialize 및 serialize합니다. 자세히 알아보기

리터럴 표시

date("<dateOnly in ISO-8601 format>")

예

date("2021-02-19")

dateTimeOnly date-time-only

설명

표준 시간대 없이 연-월-일-시간-분-초(밀리초)로 표시되는 날짜 시간을 나타냅니다.

JSON 형식: 문자열.

시간대를 저장하거나 나타내지 않습니다. 대신, 월시계에서 본 현지 시간과 결합하여 생일 때 사용되는 날짜의 설명입니다.

오프셋이나 시간대와 같은 추가 정보 없이 타임라인에서 순간을 나타낼 수 없습니다.

toDateTimeOnly 함수에 캡슐화할 수 있습니다.

직렬화 포맷: ISO-8601 확장 오프셋 날짜-시간 포맷.

DateTimeFormatter ISO_LOCAL_DATE_TIME을 사용하여 값을 deserialize 및 serialize합니다. 자세히 알아보기{_blank}

리터럴 표시

date("<dateTimeOnly in ISO-8601 format>")

예

date("2024-02-19T00.00.000")
date("2024-02-19T00.00")

dateTime date-time

설명

시간대도 고려하는 날짜 시간 상수입니다. UTC의 오프셋이 있는 날짜-시간을 나타냅니다.

오프셋의 추가적 정보를 가지고 순간적으로 볼 수 있다. 세계의 일정한 장소에서 특정한 '순간’을 나타내는 방법이다.

JSON 형식: 문자열.

toDateTime 함수에 캡슐화할 수 있습니다.

직렬화 포맷: ISO-8601 확장 오프셋 날짜-시간 포맷.

DateTimeFormatter ISO_OFFSET_DATE_TIME을 사용하여 값을 deserialize 및 serialize합니다. 자세히 알아보기{_blank}

에포크 값을 전달하는 정수를 전달할 수도 있습니다. 자세히 보기{_blank}.

시간대는 오프셋 또는 시간대 코드(예: 유럽/파리, Z - UTC 의미)로 지정할 수 있습니다.

리터럴 표시

toDateTime("<dateTime in ISO-8601 format>")
date("<dateTime in ISO-8601 format>")
toDateTime(<integer value of an epoch in milliseconds>)

예

date("2024-02-19T00.00.000Z")
toDateTime("1977-04-22T06:00:00Z")
toDateTime("2023-12-03T15:15:30Z")
toDateTime("2023-12-03T15:15:30.123Z")
toDateTime("2023-12-03T15:15:30.123+02:00")
toDateTime("2023-12-03T15:15:30.123-00:20")
toDateTime(1560762190189)

지속 시간 duration

설명

이는 '34.5초’와 같이 시간 기반 시간을 나타냅니다. 그것은 밀리초로 수량이나 시간을 모델링한다.

지원되는 시간 단위는 밀리초, 초, 분, 시간, 일수가 24시간과 같은 경우입니다. 연도 및 월은 고정된 시간이 아니므로 지원되지 않습니다.

JSON 형식: 문자열.

toDuration 함수에 캡슐화해야 합니다.

직렬화 형식: 시간대 ID를 역직렬화하려면 java 함수 java.time을 사용합니다.

Duration.parse: 허용되는 형식은 ISO-8601 기간 형식 PnDTnHnMn.nS를 기반으로 하며, 일은 정확히 24시간으로 간주됩니다. 자세히 알아보기{_blank}

리터럴 표시

toDuration("<duration in ISO-8601 format>")
toDuration(<duration in milliseconds>)

예

toDuration("PT5S") -- parses as 5 seconds
toDuration(500) -- parses as 500ms
toDuration("PT20.345S") -- parses as "20.345 seconds"
toDuration("PT15M") -- parses as "15 minutes" (where a minute is 60 seconds)
toDuration("PT10H")  -- parses as "10 hours" (where an hour is 3600 seconds)
toDuration("P2D") -- parses as "2 days" (where a day is 24 hours or 86400 seconds)
toDuration("P2DT3H4M") -- parses as "2 days, 3 hours and 4 minutes"
toDuration("P-6H3M") -- parses as "-6 hours and +3 minutes"
toDuration("-P6H3M") -- parses as "-6 hours and -3 minutes"
toDuration("-P-6H+3M") -- parses as "+6 hours and -3 minutes"

list list

설명

대괄호를 구분 기호로 사용하여 쉼표로 구분된 표현식 목록입니다.

다형성은 지원되지 않으므로 목록에 포함된 모든 표현식의 유형이 같아야 합니다.

리터럴 표시

[<expression>, <expression>, ... ]

예

["value1","value2"]
[3,5]
[toDuration(500),toDuration(800)]
AI Knowledge Reference

This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.

For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.

  • TL;DR: This page describes every data type supported in the Journey advanced expression editor — string, integer, decimal, boolean, dateOnly, dateTimeOnly, dateTime, duration, and list — with their JSON formats, serialization rules, and literal representation syntax.

Intents:

  • Identify the correct literal syntax for each data type when writing journey expressions
  • Understand the difference between dateOnly, dateTimeOnly, and dateTime types and when to use each
  • Represent a duration value using ISO-8601 format or milliseconds with the toDuration() function
  • Construct a list expression with square bracket syntax for use in collection operations
  • Use conversion functions (toDateTime, toDateTimeOnly, toDuration, toDateOnly) to create typed constants

Glossary:

  • dateOnly: A date without time or time zone, formatted as YYYY-MM-DD; suitable for birthdays or calendar dates (product-specific)
  • dateTimeOnly: A date and time without time zone information; cannot represent a specific instant without an offset (product-specific)
  • dateTime: A date-time constant that includes a UTC offset, representing a specific instant; can also be created from an epoch integer (product-specific)
  • duration: A time-based amount modelled in milliseconds; uses ISO-8601 PnDTnHnMn.nS format; years and months are not supported (product-specific)
  • list: A comma-separated collection of expressions of the same type, delimited by square brackets (product-specific)

Guardrails:

  • Duration supports milliseconds, seconds, minutes, hours, and days only — years and months are not supported as they are not fixed amounts of time
  • A duration value must be wrapped in toDuration() — it cannot be expressed as a bare literal
  • All expressions in a list must have the same type — polymorphism is not supported
  • dateTimeOnly cannot represent an instant in time without an additional offset or time zone

Terminology:

  • Canonical name: Data Types — Acronym: none — variants: expression data types, journey data types
  • Synonyms: “dateTime” = “date-time with timezone”; “dateTimeOnly” = “local date-time”
  • Do not confuse: dateOnly (no time) ≠ dateTimeOnly (date + time, no timezone) ≠ dateTime (date + time + timezone/offset)

FAQ:

  • Q: What is the difference between dateTimeOnly and dateTime? — dateTimeOnly has no time zone or offset and cannot represent a precise instant; dateTime includes a UTC offset and represents a specific moment in time.
  • Q: How do I express a duration of 2 days and 3 hours? — Use toDuration("P2DT3H").
  • Q: Can I mix integers and strings in a list expression? — No; all expressions in a list must be the same type.
  • Q: How do I create a dateTime from an epoch timestamp in milliseconds? — Use toDateTime(<epoch in milliseconds>), for example toDateTime(1560762190189).
  • Q: Is true or True the correct boolean literal? — Use lowercase true or false; uppercase variants are not valid.
recommendation-more-help
journey-optimizer-help