majiidd / persiantools Goto Github PK
View Code? Open in Web Editor NEWJalali date and datetime with other tools
License: MIT License
Jalali date and datetime with other tools
License: MIT License
hi
thanks for publishing this package
please create and update CHANGELOG
file
Hey.
Code:
from django.utils import timezone
JalaliDateTime.to_jalali(self.created_at, tzinfo=timezone.tzinfo).strftime('%d %B %Y - %H:%M', locale='fa')
Execption:
tzname(dt) argument must be a datetime instance or None, not JalaliDateTime
Hello
from persiantools.jdatetime import JalaliDateTime
jalai = JalaliDateTime.now()
print(jalali)
print(jalali.date())
when i use .date() it converts to Gregorian:
1399-06-14 02:41:06.377834
2020-09-04
Thank you.
wrong conversion in JalaliDate() (Gregorian to Jalali) on version 4.0.0
Hi my friend.
Converting from Gregorian to Jalali Date in a specific date which has repeated every 4 years returns wrong result.
Wrong dates are exactly one year before the Jalali leap years (سال کبیسه).
see below examples:
from persiantools.jdatetime import JalaliDate
import datatime
print(JalaliDate(datatime.date(2020, 3, 18))) # 1398-12-28 (correct)
print(JalaliDate(datatime.date(2020, 3, 19))) # 1398-12-29 (correct)
print(JalaliDate(datatime.date(2020, 3, 20))) # 1398-01-01 (incorrect) --> should be 1399-01-01
print(JalaliDate(datatime.date(2020, 3, 21))) # 1399-01-02 (correct)
Converting all these days will give incorrect results and the result should be one year ahead:
...
2024, 3, 20
2020, 3, 20
2016, 3, 20
2012, 3, 20
...
Version 3.0.1 has no problems.
Hi there,
Since there is no implementation for strptime function, I wonder is there any alternative way for converting string to date object?
Hello,
I tried to install this package on my conda environment by typing:
conda install persiantools
But it fails:
$ conda install persiantools
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- persiantools
Current channels:
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
Is there any solution?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.