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

Date function missing #9

Open
FabienGiely opened this issue Nov 8, 2019 · 2 comments
Open

Date function missing #9

FabienGiely opened this issue Nov 8, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@FabienGiely
Copy link
Contributor

We should add a "nlg_date" function, witch have default behaviors depending on language

@FabienGiely FabienGiely added the enhancement New feature or request label Nov 8, 2019
@printfhere
Copy link
Contributor

Maybe we should add something like this:

if platform.system() == "Windows":
date_format = "%A %#d %B %Y"
locale.setlocale(locale.LC_TIME, 'fr')
else:
date_format = "%A %-d %B %Y"
locale.setlocale(locale.LC_TIME, 'fr_FR.utf8')

day, month, year = (int(x) for x in date.split('/'))
date = datetime.date(year, month, day)

@FabienGiely
Copy link
Contributor Author

I think it's more about changing the format of a date (from the input for example) than getting the system date. But maybe we can have both.

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

No branches or pull requests

2 participants