跳转至内容

Rebol 编程/to-idate

来自维基教科书,开放的书籍,开放的世界
TO-IDATE date 

返回标准互联网日期字符串。

TO-IDATE 是一个函数值。

  • 日期 -- (类型:日期)

源代码

[编辑 | 编辑源代码]
to-idate: func [
    "Returns a standard Internet date string." 
    date [date!] 
    /local str
][
    str: form date/zone 
    remove find str ":" 
    if (first str) <> #"-" [insert str #"+"] 
    if (length? str) <= 4 [insert next str #"0"] 
    reform [
        pick ["Mon," "Tue," "Wed," "Thu," "Fri," "Sat," "Sun,"] date/weekday 
        date/day 
        pick ["Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"] date/month 
        date/year 
        to-itime any [date/time 0:00] 
        str
    ]
]
华夏公益教科书