Python에서 약속 관리

약속 생성 및 저장

다음은 Appointment Aspose.Email API의 클래스는 ICS 형식의 약속을 로드하고 새 약속을 생성하여 디스크에 ICS 형식으로 저장하는 데 사용할 수 있습니다.

약속을 생성하고 ICS로 저장

다음 코드 스니펫은 약속을 생성하고 디스크에 ICS 형식으로 저장하는 방법을 보여줍니다:

  1. 다음의 인스턴스를 생성합니다 MailAddressCollection 참석자 이메일 주소를 저장하고 참석자 이메일을 다음에 추가합니다 MailAddressCollection 다음 사용 append() 메서드.
  2. 다음 사용 Appointment 위치, 시작 시간, 종료 날짜, 주최자 이메일 및 참석자 목록과 같은 세부 정보로 새 약속을 생성하는 생성자.
  3. 약속 속성(요약 및 설명)을 설정하여 회의 세부 사항을 설명합니다.
  4. ICS 형식으로 약속을 저장하려면 save() 파일 경로와 형식을 지정하는 메서드.
import datetime
import aspose.email as ae
from aspose.email.calendar import Appointment, AppointmentSaveFormat

attendees = ae.MailAddressCollection()
attendees.append(ae.MailAddress("attendee@domain.com"))

appointment = Appointment(
    "Room 112",                                   # location
    datetime.datetime(2026, 5, 27, 22, 12, 11),   # start date
    datetime.datetime(2026, 5, 28, 23, 12, 11),   # end date
    ae.MailAddress("organizer@domain.com"),       # organizer
    attendees)
appointment.summary = "Release Meeting"
appointment.description = "Discuss the next release"

appointment.save(data_dir + "AppointmentInICSFormat.ics", AppointmentSaveFormat.ICS)
print("saved")

이 약속은 Microsoft Outlook이나 ICS 파일을 로드할 수 있는 모든 프로그램에서 열 수 있습니다. 파일을 Microsoft Outlook에서 열면 자동으로 Outlook 캘린더에 약속이 추가됩니다.

HTML 콘텐츠가 포함된 약속 생성

다양한 콘텐츠 유형으로 이벤트 설명의 대체 표현을 지정하려면 X-ALT-DESC 헤더와 함께 제공합니다. 이는 iCalendar 파일 수신자가 자신의 필요에 맞는 표현을 선택할 수 있게 합니다. 예를 들어, text/plain 콘텐츠 유형과 HTML 설명을 text/html 콘텐츠 유형. The X-ALT-DESC 헤더가 각 대체 표현에 추가됩니다.

HTML 콘텐츠가 포함된 약속을 만들려면 html_description 속성 Appointment 클래스:

import datetime
import aspose.email as ae
from aspose.email.calendar import Appointment

attendees = ae.MailAddressCollection()
attendees.append(ae.MailAddress("AinaMartensson@to.com", "Aina Martensson"))

appointment = Appointment(
    "Bygget 83",                                                     # location
    datetime.datetime.utcnow(),                                      # start date
    datetime.datetime.utcnow() + datetime.timedelta(hours=1),        # end date
    ae.MailAddress("TintinStrom@from.com", "Tintin Strom"),          # organizer
    attendees)

appointment.html_description = """
<html>
 <style type="text/css">
  .text {
         font-family:'Comic Sans MS';
         font-size:16px;
        }
 </style>
<body>
 <p class="text">Hi, I'm happy to invite you to our party.</p>
</body>
</html>"""

appointment.save("appointment_with_html.ics")

iCalendar용 제품 식별자 사용자 정의

Aspose.Email을 사용하면 iCalendar 객체를 만든 제품의 식별자를 가져오거나 설정할 수 있습니다. 사용 product_id 속성 AppointmentIcsSaveOptions 클래스:

import datetime
import aspose.email as ae
from aspose.email.calendar import Appointment, AppointmentIcsSaveOptions

attendees = ae.MailAddressCollection()
attendees.append(ae.MailAddress("second@test.com"))

app = Appointment("location",
                  datetime.datetime.today(),
                  datetime.datetime.today() + datetime.timedelta(days=1),
                  ae.MailAddress("first@test.com"),
                  attendees)
app.summary = "test appointment"
app.description = "Test Description"

save_options = AppointmentIcsSaveOptions()
save_options.product_id = "Test Corporation"

app.save("ChangeProdIdOfICS.ics", save_options)

초안 약속 요청 생성

초안 모드에서 약속 요청을 생성해야 하는 경우가 많으며, 기본 정보를 추가한 후 동일한 초안 약속을 개별 요청에 따라 필요한 변경을 위해 다른 사용자에게 전달할 수 있습니다. 초안 모드에서 약속을 저장하려면, method_type 속성 Appointment 클래스는 ‘publish’로 설정되어야 합니다. 다음 코드 스니펫은 초안 약속 요청을 생성하는 방법을 보여줍니다.

import datetime
import aspose.email as ae
from aspose.email.calendar import Appointment, AppointmentMethodType
from aspose.email.mapi import MapiMessage

attendees = ae.MailAddressCollection()
attendees.append(ae.MailAddress("attendee@domain.com"))

appointment = Appointment("Room 112",
                          datetime.datetime(2026, 5, 27, 22, 12, 11),
                          datetime.datetime(2026, 5, 28, 23, 12, 11),
                          ae.MailAddress("organizer@domain.com"),
                          attendees)
appointment.summary = "Release Meeting"
appointment.description = "Discuss the next release"
appointment.method_type = AppointmentMethodType.PUBLISH

message = ae.MailMessage("sender@domain.com", "recipient@domain.com", "", "")
message.add_alternate_view(appointment.request_apointment())

msg = MapiMessage.from_mail_message(message)

# Save the appointment as a draft
msg.save(data_dir + "DraftAppointmentRequest.msg")
print("saved draft")

텍스트에서 초안 약속

다음 코드 스니펫은 텍스트에서 초안 약속을 생성하는 방법을 보여줍니다. 

import aspose.email as ae
from aspose.email.mapi import MapiMessage
from aspose.email.mime import ContentType

ical = """BEGIN:VCALENDAR
METHOD:PUBLISH
PRODID:-//Aspose Ltd//iCalender Builder (v3.0)//EN
VERSION:2.0
BEGIN:VEVENT
ATTENDEE;CN=attendee@domain.com:mailto:attendee@domain.com
DTSTART:20260220T171439
DTEND:20260220T174439
DTSTAMP:20260220T161439Z
END:VEVENT
END:VCALENDAR"""

message = ae.MailMessage("sender@domain.com", "recipient@domain.com", "", "")
alternate_view = ae.AlternateView.create_alternate_view_from_string(
    ical, ContentType("text/calendar"))
message.alternate_views.append(alternate_view)

msg = MapiMessage.from_mail_message(message)
msg.save(data_dir + "DraftAppointmentFromString.msg")
print("saved")

약속 로드 및 읽기

ICS 파일에서 약속 로드

다음 코드 스니펫은 ICS 형식으로 약속을 로드하는 방법을 보여줍니다:

  1. 다음 사용 Appointment.load() 경로를 지정하여 기존 ICS 파일에서 약속을 로드하는 메서드.
  2. 약속 세부 정보(요약, 위치, 설명, 시작 날짜, 종료 날짜, 주최자 및 참석자)를 검색하고 표시합니다.
from aspose.email.calendar import Appointment

appointment = Appointment.load(data_dir + "appointment.ics")

print("Summary:", appointment.summary)
print("Location:", appointment.location)
print("Description:", appointment.description)
print("Start date:", appointment.start_date)
print("End date:", appointment.end_date)
print("Organizer:", appointment.organizer.address)
print("Attendees:", appointment.attendees[0].address)

ICS를 MSG로 변환

API를 사용하면 약속을 메시지 객체로 쉽게 변환할 수 있습니다. 다음 코드 샘플은 약속 요청을 MailMessage 또는 MapiMessage:

from aspose.email.calendar import Appointment

appointment = Appointment.load("appRequest.ics")

eml = appointment.to_mail_message()
msg = appointment.to_mapi_message()

약속 버전 확인

약속의 버전을 결정하려면 version 속성 Appointment 클래스. 파일이 어떤 버전을 기반으로 하는지 판단하는 데 도움이 되며, 다른 시스템 및 앱과의 통합을 쉽게 합니다. 해당 속성은 ICS/VCS 버전을 보유하는 문자열입니다 — "2.0" iCalendar용으로 예를 들어 사용할 수 있습니다.

from aspose.email.calendar import Appointment

app = Appointment.load("meeting.ics")

if app.version == "2.0":
    # do something
    print("iCalendar 2.0")

ICS 파일에서 여러 이벤트 읽기

Aspose.Email을 사용하면 지정된 ICS 파일에서 모든 이벤트를 읽어 리스트에 저장하고, 총 약속 수를 출력할 수 있습니다. 다음 코드 샘플은 이 작업을 수행하는 방법을 보여줍니다:

  1. 다음 사용 CalendarReader 캘린더 이벤트가 포함된 ICS 파일을 처리할 리더를 초기화하는 클래스입니다. 생성자에서 ICS 파일 위치를 지정합니다.
  2. ‘appointments’라는 빈 리스트를 생성하여 ICS 파일에서 읽은 이벤트를 저장합니다.
  3. 다음을 사용하여 ICS 파일의 각 이벤트를 반복합니다 reader.next_event().
  4. 현재 이벤트(reader.current)를 약속 리스트에 추가합니다.
  5. 총 약속 수를 출력합니다.
from aspose.email.calendar import CalendarReader

reader = CalendarReader(data_dir + "appointment.ics")

appointments = []
while reader.next_event():
    appointments.append(reader.current)

print("Total Appointments:", len(appointments))

약속 쓰기 및 업데이트

여러 이벤트를 ICS 파일에 쓰기

여러 이벤트를 ICS 파일에 생성하고 저장합니다. 각 이벤트는 참석자, 위치, 시간 및 설명 정보를 포함합니다. 다음 코드 샘플은 여러 약속 이벤트를 ICS 캘린더 파일에 생성하고 저장하는 방법을 보여줍니다:

  1. 다음의 인스턴스를 생성합니다 AppointmentIcsSaveOptions 캘린더 이벤트가 저장되는 방식을 지정합니다.
  2. 설정합니다. action 속성 AppointmentAction.CREATE ICS 파일에 약속을 생성해야 함을 나타냅니다.
  3. 다음 사용 CalendarWriter 출력 파일 경로와 이전에 정의한 저장 옵션을 제공하여 이벤트를 ICS 파일에 출력하는 작성을 설정하는 클래스.
  4. 다음을 생성합니다 MailAddressCollection 각 약속에 대한 참석자 목록을 관리합니다. 이 컬렉션에 특정 이메일 주소를 추가하려면 append() 메서드.
  5. for 루프를 사용하여 10번 반복하며 10개의 약속 이벤트를 생성합니다. 각 반복마다 다음을 생성합니다 Appointment 위치, 시작 시간, 종료 날짜, 주최자 이메일 및 참석자와 같은 지정된 세부 정보가 포함된 인스턴스.
  6. 이벤트 세부 정보를 추가합니다: description 및 summary 속성.
  7. 다음 사용 write 작성자를 사용하여 약속을 ICS 파일에 출력하는 메서드.
import datetime
import aspose.email as ae
from aspose.email.calendar import (Appointment, AppointmentAction,
                                   AppointmentIcsSaveOptions, CalendarWriter)

save_options = AppointmentIcsSaveOptions()
save_options.action = AppointmentAction.CREATE

writer = CalendarWriter(data_dir + "WriteMultipleEventsToICS.ics", save_options)

attendees = ae.MailAddressCollection()
attendees.append(ae.MailAddress("attendee@domain.com"))

for i in range(10):
    appointment = Appointment("Room 112",
                              datetime.datetime(2026, 5, 27, 22, 12, 11),
                              datetime.datetime(2026, 5, 28, 23, 12, 11),
                              ae.MailAddress("organizer@domain.com"),
                              attendees)
    appointment.description = "Test body " + str(i)
    appointment.summary = "Test summary: " + str(i)
    writer.write(appointment)
print("written")

약속 참석자에 대한 참가자 상태 설정

Aspose.Email은 회신 메시지를 작성하는 동안 약속 참석자의 상태를 설정할 수 있게 합니다. 각 참석자에게 이러한 상태를 지정하면 Appointment 객체를 사용하는 애플리케이션이나 시스템이 확인된 참석자 표시, 변경 추적 또는 알림 관리와 같은 이벤트 관련 로직을 처리할 수 있습니다.

import datetime
import aspose.email as ae
from aspose.email.calendar import Appointment, AppointmentSaveFormat

organizer = ae.MailAddress("organizer@domain.com", "Organizer")

attendee1 = ae.MailAddress("first.attendee@domain.com", "First attendee")
attendee1.participation_status = ae.ParticipationStatus.ACCEPTED

attendee2 = ae.MailAddress("second.attendee@domain.com", "Second attendee")
attendee2.participation_status = ae.ParticipationStatus.DECLINED

attendees = ae.MailAddressCollection()
attendees.append(attendee1)
attendees.append(attendee2)

appointment = Appointment("Room 5",
                          datetime.datetime(2026, 12, 10, 10, 12, 11),
                          datetime.datetime(2026, 12, 10, 11, 12, 11),
                          organizer, attendees)

appointment.save(data_dir + "AppointmentWithParticipantStatus.ics", AppointmentSaveFormat.ICS)

회의 요청 전송 및 취소

다음은 Appointment 클래스와 함께 추가됩니다. SmtpClient, 이메일로 회의 요청, 반복 회의 요청, 업데이트 및 취소를 보낼 때 사용할 수 있습니다. 약속은 다음에 추가됩니다: MailMessage 대체 보기로.

회의 요청 보내기

회의 요청을 보내려면 약속을 만들고, 그 약속을 다음을 사용하여 메시지에 추가하십시오: request_apointment() 메서드와 메시지를 보냅니다. 저장하십시오: unique_id 업데이트나 취소를 보낼 때 나중에 동일한 약속을 참조할 수 있도록 약속의 값.

import datetime
import aspose.email as ae
from aspose.email.calendar import Appointment
from aspose.email.clients.smtp import SmtpClient

# Create an instance of SmtpClient
client = SmtpClient("smtp.gmail.com", 587, "user@gmail.com", "password")
client.security_options = ae.clients.SecurityOptions.AUTO

# Gather the attendees
attendees = ae.MailAddressCollection()
attendees.append(ae.MailAddress("first.attendee@domain.com", "First Attendee"))
attendees.append(ae.MailAddress("second.attendee@domain.com", "Second Attendee"))

# Create the message and the appointment
msg = ae.MailMessage()
msg.from_address = ae.MailAddress("organizer@domain.com")
msg.to = attendees

app = Appointment("Meeting Room 1",
                  datetime.datetime.now(),
                  datetime.datetime.now() + datetime.timedelta(hours=1),
                  msg.from_address, attendees)
app.summary = "Monthly Meeting"
app.description = "Please confirm your availability."

# Add the appointment to the message and send it
msg.add_alternate_view(app.request_apointment())
client.send(msg)

재발 회의 요청 보내기

반복 일정이 있는 회의 요청을 만들려면 반복 패턴을 할당하십시오 — WeeklyRecurrencePattern, 예를 들어 — 에게 recurrence 약속의 속성. 약속의 고유 ID를 저장하면 나중에 업데이트를 보낼 때 해당 약속을 참조할 수 있습니다.

import datetime
import uuid
import aspose.email as ae
from aspose.email.calendar import Appointment
from aspose.email.calendar.recurrences import WeeklyRecurrencePattern, CalendarDay

# Create a mail message
msg = ae.MailMessage()
msg.to.append(ae.MailAddress("to@domain.com"))
msg.from_address = ae.MailAddress("from@gmail.com")

# Fill the appointment object
start_date = datetime.datetime(2025, 12, 1, 17, 0, 0)
end_date = datetime.datetime(2025, 12, 31, 17, 30, 0)
agenda_appointment = Appointment("same place", start_date, end_date, msg.from_address, msg.to)

# Create a unique id so that the appointment can be accessed later
unique_id = str(uuid.uuid4())
agenda_appointment.unique_id = unique_id
agenda_appointment.description = "----------------"

# Create a weekly recurrence pattern: Mon, Tue and Thu
pattern = WeeklyRecurrencePattern(14)
pattern.start_days = [CalendarDay.MONDAY, CalendarDay.TUESDAY, CalendarDay.THURSDAY]
pattern.interval = 1

# Set the recurrence pattern for the appointment
agenda_appointment.recurrence = pattern

# Attach the appointment to the mail
msg.alternate_views.append(agenda_appointment.request_apointment())

msg.save("recurring_request.eml", ae.SaveOptions.default_eml)

약속 업데이트 요청 보내기

이전에 보낸 약속에 대한 업데이트를 보내려면 고유 ID가 필요합니다. 다음을 사용하십시오: update_appointment() 업데이트 교체 보기를 구축하는 메서드:

import datetime
import aspose.email as ae
from aspose.email.calendar import Appointment

unique_id = "the id stored when the request was sent"

start_date = datetime.datetime(2025, 12, 12, 17, 0, 0)
end_date = datetime.datetime(2025, 12, 12, 17, 30, 0)

attendees = ae.MailAddressCollection()
attendees.append(ae.MailAddress("attendee@domain.com"))

app_update = Appointment("Different Place", start_date, end_date,
                         ae.MailAddress("organizer@gmail.com"), attendees)
app_update.unique_id = unique_id
app_update.summary = "update meeting request summary"
app_update.description = "update"

msg_update = ae.MailMessage("organizer@gmail.com", "attendee@domain.com",
                            "test email - update meeting request", "test email")
msg_update.add_alternate_view(app_update.update_appointment())

msg_update.save("meeting_update.eml", ae.SaveOptions.default_eml)

회의 요청 취소

회의를 취소하려면 요청이 전송될 때 저장한 정보를 사용하여 동일한 약속을 만든 뒤, cancel_appointment() 메서드와 참석자에게 메시지를 보냅니다:

import datetime
import aspose.email as ae
from aspose.email.calendar import Appointment

# Re-create the attendee collection and the appointment from your stored data
attendees = ae.MailAddressCollection()
attendees.append(ae.MailAddress("first.attendee@domain.com", "First Attendee"))
attendees.append(ae.MailAddress("second.attendee@domain.com", "Second Attendee"))

app = Appointment("Meeting Room 1",
                  datetime.datetime.now(),
                  datetime.datetime.now() + datetime.timedelta(hours=1),
                  ae.MailAddress("organizer@domain.com", "Organizer"), attendees)
app.summary = "Monthly Meeting"
app.description = "Please confirm your availability."

# Create the cancellation message
msg = ae.MailMessage()
msg.from_address = ae.MailAddress("organizer@domain.com")
msg.to = attendees
msg.subject = "Cancel meeting"
msg.add_alternate_view(app.cancel_appointment())

msg.save("meeting_cancellation.eml", ae.SaveOptions.default_eml)

iCalendar 재발 패턴 작업

반복 패턴은 특정 일정을 설명하는 방법입니다. 일정에 따라 발생(날짜와 시간) 목록을 만들기에 충분한 정보를 포함합니다. 반복 패턴은 전체 패턴을 형성하기 위해 결합되는 규칙을 포함할 수 있습니다. 일반적으로 반복 패턴이 복잡할수록 더 많은 반복 규칙을 포함합니다.

반복 패턴에는 예외가 포함될 수 있습니다. 예외는 원래 패턴에 상대적인 발생 날짜를 추가하거나 제거합니다. 명시적 발생이나 자체 패턴으로 지정할 수 있습니다. 예외가 포함된 반복 패턴 예:

  • 6월부터 8월까지를 제외하고 매 두 번째 금요일마다.
  • 1월을 제외한 매월 1일, 단 1월은 2일이어야 합니다.

iCalendar에서 정의된 반복 패턴 속성은 다음과 같습니다:

  • DTSTART – 패턴의 시작 날짜와 시간(명시적으로 제외되지 않은 경우 첫 발생도 의미합니다).
  • RRULE – 재발 집합에 대한 반복 규칙을 지정합니다.
  • RDATE – 재발 집합에 포함할 날짜와 시간 목록을 정의합니다.
  • EXRULE – 재발 집합에서 제외할 규칙을 지정합니다.
  • EXDATE – 재발 집합에서 제외할 날짜와 시간 목록을 정의합니다.

DTSTART만 필수이며, 반드시 하나만 존재해야 합니다. 나머지 속성은 선택 사항이며 여러 번 지정할 수 있습니다.

Aspose.Email 재발 객체 모델

다음은 aspose.email.calendar.recurrences 모듈에는 iCalendar 반복 작업에 사용되는 클래스가 포함됩니다. CalendarRecurrence 및 RecurrenceRule 가 핵심 클래스입니다.

  • 다음은 CalendarRecurrence 클래스는 전체 반복 패턴을 나타냅니다. 기본 생성자를 사용해 새 패턴을 만들거나, 기존 iCalendar 문자열을 전달해 생성자를 통해 구축할 수 있습니다.
  • 다음은 RecurrenceRule 클래스는 RRULE 또는 EXRULE 부분을 나타냅니다. 해당 속성은 iCalendar 표준의 대응 속성과 직접 매핑됩니다 — by_month BYMONTH 등에 매핑됩니다.

다음 코드 조각은 반복 패턴을 로드하고 발생을 생성합니다:

from aspose.email.calendar.recurrences import CalendarRecurrence

# Ten team meetings, every Monday at 10am
pattern = CalendarRecurrence("DTSTART:20040301T100000\nRRULE:FREQ=WEEKLY;COUNT=10;BYDAY=MO")

dates = pattern.generate_occurrences()

for date in dates:
    print(date)

재발 패턴에서 발생 생성

"다음" 발생을 얻으려면 generate_occurrences 인수와 함께 1을 통해 얻을 수 있습니다. 다음 코드 조각은 패턴을 프로그래밍 방식으로 구축하고 20개의 발생을 생성합니다:

import datetime
from aspose.email.calendar.recurrences import CalendarRecurrence, Frequency

recurrence_pattern = CalendarRecurrence()
recurrence_pattern.start_date = datetime.datetime(1997, 9, 10, 9, 0, 0)

rule = recurrence_pattern.r_rules.add()
rule.frequency = Frequency.MONTHLY
rule.count = 20
rule.interval = 18
rule.by_month_day.add([10, 11, 12, 13, 14, 15])

expected_dates = recurrence_pattern.generate_occurrences(20)

print("expected_dates count = " + str(len(expected_dates)))
for date in expected_dates:
    print("DateTime = " + str(date))

재발에 대한 사용자 친화적인 텍스트 가져오기

규칙에 대한 사용자 친화적인 텍스트는 friendly_text 속성. 다음 코드의 출력은: "한 달에 1번째와 마지막 1번째 일에 최대 2번 발생하도록 재발합니다." 입니다.

from aspose.email.calendar.recurrences import RecurrenceRule, Frequency

rule = RecurrenceRule()
rule.frequency = Frequency.MONTHLY
rule.count = 2
rule.by_month_day.add(1)
rule.by_month_day.add(-1)

print(rule.friendly_text)

샘플 재발 패턴

다음 RRULE 샘플 문자열은 일반적인 일정 표현 방법을 보여줍니다.

  • 매월 마지막 일. 월의 마지막 전날에 발생을 원한다면 BYMONTHDAY=-2. 다음을 지정하면 BYMONTHDAY=31, 그러면 iCalendar 표준에 따라 31일 미만인 달에는 발생이 생성되지 않습니다.

    RRULE:FREQ=MONTHLY;BYMONTHDAY=-1
    
  • 매달 마지막 근무일. 이 규칙은 한 달의 모든 근무일을 지정하고 그 중 마지막을 선택합니다.

    RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1
    
  • 연도의 마지막 월요일

    RRULE:FREQ=YEARLY;BYDAY=-1MO
    
  • 연도의 첫 ISO 8601 주에 해당하는 금요일. ISO 8601 규격에서는 연도의 첫 주가 최소 4일을 포함하는 첫 주입니다.

    FREQ=YEARLY;BYWEEKNO=1;BYDAY=FR
    
  • 연도의 첫 금요일. 예를 들어 1999년의 경우 첫 금요일은 1999/01/01이고, ISO 8601 기준 첫 주의 금요일은 1999/01/08입니다.

    FREQ=YEARLY;BYDAY=1FR
    

중요한 iCalendar (RFC 2445) 세부 정보

날짜 또는 시간과 연관된 날짜는 DTSTART, UNTIL, EXDATE 및 RDATE 요소에서 반복 패턴을 지정할 때 사용할 수 있습니다. iCalendar는 달력 날짜를 포함하는 값을 식별하기 위해 DATE 유형을, 정확한 날짜와 시간을 지정하기 위해 DATE-TIME 유형을 정의합니다. DATE-TIME 값은 로컬 시간, UTC 시간, 그리고 시간대가 포함된 로컬 시간의 세 형태로 지정될 수 있습니다.

  • DATE. iCalendar 표준에 따르면 DATE 값은 yyyyMMdd 형식입니다. 예를 들어, 19970714 1997년 7월 14일을 나타냅니다.
  • 시간대가 없는 DATE-TIME. 로컬 시간 형태의 날짜-시간 값은 UTC 표기자를 포함하지 않으며 시간대를 참조하지 않습니다. 예를 들어 DTSTART:19980118T230000 1998년 1월 18일 오후 11시를 나타냅니다. 이 유형의 날짜-시간 값은 "부동"이라고 하며 특정 시간대에 묶여 있지 않습니다.
  • UTC 시간이 포함된 DATE-TIME. UTC 시간(절대 시간)이 포함된 날짜는 대문자 Z로 표시됩니다. Z 시간 값에 접미사가 추가됩니다. 예를 들어, DTSTART:19980119T070000Z 1998년 1월 19일 0700 UTC를 나타냅니다. Aspose.Email은 UTC 접미사를 무시합니다. Z 접미사를 사용하고 시간을 로컬 시간으로 처리합니다. RFC 2445 표준에 따르면 재발 규칙의 UNTIL 규칙에 지정된 시간 부분은 UTC 형식이어야 하며, Aspose.Email은 UNTIL 규칙에서 어떤 형식이든 허용합니다.
  • 현지 시간 및 시간대가 포함된 DATE-TIME. 시간대를 참조하려면 DATE-TIME에 TZID 속성을 추가합니다. 예를 들어, DTSTART;TZID=US-Eastern:19980119T020000 1998년 1월 19일 뉴욕 현지 시간으로 오전 2시를 나타냅니다. 현재 Aspose.Email은 TZID 매개변수를 무시하고 시간을 로컬 시간으로 처리합니다.
  • BYWEEKNO 및 ISO 8601 준수. BYWEEKNO는 다음과 같은 경우에만 사용하십시오. ISO 8601 필수입니다. ISO 8601에 정의된 주 번호는 일반적인 의미와 다릅니다: 연도 첫 주는 최소 4일을 포함하는 첫 주입니다. BYWEEKNO 규칙은 연도의 주 번호를 콤마로 구분한 목록을 지정하며(유효값은 153 및 -1-53), YEARLY 규칙에만 적용됩니다.

관련 항목