格式化出口的时间 [英] Formatting time for ical export
问题描述
我已经在jquery中创建了一个导出到ical的日历。但是,我在datetime上遇到一些问题。
I have created a calendar in jquery that exports to ical. However, I am having some issues with the datetime.
ical导出脚本期望以下格式的日期/时间:19970714T170000Z。
The ical export script expects the date/time in this format: 19970714T170000Z.
有没有人知道这是什么,我应该如何准备我的字符串?
Does anybody know what this is and how I should prepare my string?
谢谢
推荐答案
阅读RFC(链接)
给出:
Reading the RFC (link) gives :
3.3.5。日期时间
3.3.5. Date-Time
[...]
date-time = dateTtime
date-time = date "T" time
DATE-TIME值类型以三种形式表达时间值:
The "DATE-TIME" value type expresses time values in three forms:
FORM#1:具有本地时间的日期
例如,以下代表1998年1月18日下午11点:$ b $ b 19980118T230000
FORM #1: DATE WITH LOCAL TIME For example, the following represents January 18, 1998, at 11 PM: 19980118T230000
FORM#2:使用UTC时间的日期
CAPITAL LETTER Z后缀字符,到时间值。
例如,以下代表1998年1月19日,0700 UTC:
19980119T070000Z
FORM #2: DATE WITH UTC TIME
CAPITAL LETTER Z suffix character, to the time value.
For example, the following represents January 19, 1998, at 0700 UTC:
19980119T070000Z
表格#3:日期与当地时间和时区参考
TZID =美国/纽约州:19980119T020000
FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE TZID=America/New_York:19980119T020000
DTSTART:19970714T133000;当地时间
DTSTART:19970714T173000Z; UTC时间
DTSTART; TZID = America / New_York:19970714T133000
;当地时间
;区域参考
DTSTART:19970714T133000 ; Local time DTSTART:19970714T173000Z ; UTC time DTSTART;TZID=America/New_York:19970714T133000 ; Local time and time ; zone reference
这篇关于格式化出口的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!