jenkins-bot has submitted this change and it was merged.
Change subject: Add Japanese date format to archivebot.py ......................................................................
Add Japanese date format to archivebot.py
This patch implements the standard Japanese date/time format used in MediaWiki.
Change-Id: I075e77974b87b519edeec9086db731e3edbc07e8 --- M archivebot.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/archivebot.py b/archivebot.py index 2b1a5f7..b3c33b4 100644 --- a/archivebot.py +++ b/archivebot.py @@ -266,6 +266,10 @@ if not TM: TM = re.search(r'(\d\d?) (\S+) (\d\d\d\d) (\d\d):(\d\d) (.*?)', line) +# Japanese: 2012年8月4日 (日) 13:01 (UTC) + if not TM: + TM = re.search(re.compile(u'(\d\d\d\d)年(\d\d?)月(\d\d?)日 (.*?) (\d\d):(\d\d) (.*?)'), + line) if TM: # Strip away all diacritics in the Mn ('Mark, non-spacing') category # NFD decomposition splits combined characters (e.g. 'ä", @@ -301,6 +305,8 @@ if not TIME: TIME = txt2timestamp(_TM, "%d %B %Y %H:%M (%Z)") if not TIME: + TIME = txt2timestamp(_TM, "%Y年%B%d日 (%a) %H:%M (%Z)") + if not TIME: TIME = txt2timestamp(re.sub(' *([^ ]+) *', '', _TM), "%H:%M, %d. %b. %Y") if TIME: