Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to support Chinese Language? #257

Open
solomsk opened this issue Dec 3, 2020 · 2 comments
Open

how to support Chinese Language? #257

solomsk opened this issue Dec 3, 2020 · 2 comments

Comments

@solomsk
Copy link

solomsk commented Dec 3, 2020

does is only support English ? not support Chinese ?
I input some chinese time ,such as "上周四" "上个月8号", output is current time .. it's incorrect ..

@solomsk
Copy link
Author

solomsk commented Dec 3, 2020

even if I set timezone to "Asia/Shanghai" , output is still current time ..

@solomsk
Copy link
Author

solomsk commented Dec 3, 2020

This is my code:

`from datetime import datetime
import parsedatetime as pdt
from pytz import timezone

cal = pdt.Calendar()
now = datetime.now()
print(now)

string = '60分钟前'
p_str = cal.parseDT(string, now, tzinfo=timezone("Asia/Shanghai"))
print(p_str[0])`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant