scrapinghub/dateparser

No apparent way to get a list of accepted regions for use with the region argument for parse.

已關閉

#465 建立於 2018年11月14日

 (1 則留言) (0 個反應) (0 位負責人)Python (443 個分叉)batch import
HacktoberfestType: Documentationgood first issue

倉庫指標

星標
 (2,318 顆星)
PR 合併指標
 (平均合併 397天 12小時) (30 天內合併 13 個 PR)

描述

No apparent way to get a list of accepted regions for use with the region argument for parse.
If there is it should be in the docs.
Also I went through the code and still not clear what exactly a region even is. ie US works but ID does not. The following is an attempt to parse a date in Asia/Makassar timezone, to show that the region is either not working or there is not enough documentation to understand how to use it properly. Again Locale should only be about the content parsing in terms of format and language, it should not be part of timezone determination or reducing/eliminating ambiguity.

>>> import dateparser as dtp
>>> dtp.parse("March 29, 1961 6:24pm", region='id')
>>> dtp.parse("March 29, 1961 6:24pm", region='ID')
>>> dtp.parse("March 29, 1961 6:24pm", region='IDN')
>>> dtp.parse("March 29, 1961 6:24pm", region='360')
>>> dtp.parse("March 29, 1961 6:24pm", region='WITA')
>>> dtp.parse("March 29, 1961 6:24pm", region='Indonesia')
>>> dtp.parse("March 29, 1961 6:24pm", region='Makassar')
>>> dtp.parse("March 29, 1961 6:24pm", region='LMT')
>>> 

貢獻者指南