Home > XModules >

Requirements

  • OS X 10.9 or later
    • Developed and tested on OS X 10.11.6.

Download

Version 1.0 -- 2018-12-26

XDate

XDate.scptd is an AppleScript Library to convert a date object into text with various formats.

You can build a date string with fexible object oriented interfaces.

use XDate : script "XDate"

tell XDate's make_with_text("2018/1/5 7:08")
(* predefined format *)
log date_as_text() -- 201815日金曜日 7:08:00
log w3c_dtf() -- 2018-12-14T19:35:35+09:00
log rfc822() -- Fri, 05 Jan 2018 07:08:00 +0900

(* build custom format *)
set_year_format("long")
set_month_format("number")

log y() & "/" & mo() & "/" & d() & " " & h() & ":" & min() & ":" & sec()
--2018/1/5 7:8:0
set_leading_zero(true)
log y() & "/" & mo() & "/" & d() & " " & h() & ":" & min() & ":" & sec()
-- 2018/01/05 07:08:00
end tell

History

  • 1.0 -- 2018-12-26
    • First release.