X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/cfc4ba97c3596db1105abc17692a54185cfd3a30..85c40964551cb74c3d6ef6bf61a12fd79013389b:/luatz/timetable.lua?ds=inline diff --git a/luatz/timetable.lua b/luatz/timetable.lua index 3bb7689..6cded31 100644 --- a/luatz/timetable.lua +++ b/luatz/timetable.lua @@ -143,6 +143,15 @@ function timetable_methods:rfc_3339 ( ) return strformat ( "%04u-%02u-%02uT%02u:%02u:%06.3f" , self:unpack ( ) ) end +local strftime = require "luatz.strftime".strftime +function timetable_methods:strftime ( format_string ) + return strftime ( format_string , self ) +end + +function timetable_methods:asctime ( ) + return self:strftime ( "%c\n" ) +end + local timetable_mt = { __index = timetable_methods ; __tostring = timetable_methods.rfc_3339 ;