Jalali Calendar, developed by Ashkan Ghassemi, is:
... a small and portable free software library to manipulate date and time in Jalali calendar system.
- name: Installing jdate
uses: davoudarsalani/action-jdate@master
with:
source: 'docker-jdate' ## default
There are ten options for source
:
- Use docker image
docker-khayyam
will pullkhayyam
docker image/repository (about 61.3MB in size) containingkhayyam
python module on Alpine Linuxdocker-persiantools
will pullpersiantools
docker image/repository (about 60.8MB in size) containingpersiantools
python module on Alpine Linuxdocker-jdatetime
will pulljdatetime
docker image/repository (about 59.8MB in size) containingjdatetime
python module on Alpine Linuxdocker-jdate
will pulljdate
docker image/repository (about 8.22MB in size) containingjdate
on Alpine Linux
- Download tar.gz file
askapache
will download from askapache.comgnu
will download from gnu.orgnongnu
will download from nongnu.org
- Clone git repository
clone-github
will clone from git.luolix.topclone-gnu
will clone from gnu.orgclone-nongnu
will clone from nongnu.org
For docker-khayyam
, docker-persiantools
or docker-jdatetime
set as source, you may use either of the following commands respectively to set date/time:
## docker-khayyam
run: date_time="$(docker run --rm -t davoudarsalani/khayyam \
python -c "import khayyam; print(khayyam.JalaliDatetime.now().strftime('%Y-%m-%d %H:%M:%S %A'))")"
## docker-persiantools
run: date_time="$(docker run --rm -t davoudarsalani/persiantools \
python -c "from persiantools.jdatetime import JalaliDateTime; print(JalaliDateTime.now().strftime('%Y-%m-%d %H:%M:%S %A'))")"
## docker-jdatetime
run: date_time="$(docker run --rm -t davoudarsalani/jdatetime \
python -c "import jdatetime; print(jdatetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S %A'))")"
Note: These three options, as mentioned earlier, use respective python modules.
The documents state that we can use the same format used for thedatetime
module:khayyam: The package’s API is considered to be exactly the same as the datetime module, so if you are familiar with the datetime, you can read the Migration from python’s builtin datetime.
persiantools: Jalali (Shamsi) date and datetime (based on python datetime's module)
jdatetime: This module exactly follows Python Standard datetime module’s methods
Alternatively, if docker-jdate
is set for source, you can use jdate
command to get date/time:
- name: Getting date/time
shell: bash
run: date_time="$(docker run --rm -t davoudarsalani/jdate jdate '+%Y-%m-%d %H:%M:%S %A')"
Similarly, if the other options are chosen, you can use jdate
command:
run: date_time="$(jdate '+%Y-%m-%d %H:%M:%S %A')"
Note:
jdate
anddate
share the same format.
- Jalali Calendar homepage: gnu.org and nongnu.org
- To get more versions/tags of
khayyam
/persiantools
/jdatetime
/jdate
docker images/repositories, please visit docker.com - To install
khayyam
python module, please visit pypi.org or dobisel.com - To install
persiantools
python module, please visit pypi.org or github.com - To install
jdatetime
python module, please visit pypi.org or github - To download
jcal
in tar.gz, please visit askapache.com, gnu.org or nongnu.org - To clone
jcal
repository, please visit github.com, gnu.org or nongnu.org - For instructions on how to manually download and install
jcal
/jdate
locally, please visit wiki.ubuntu.ir or wiki.ubuntu.ir - For instructions on how to use
jcal
/jdate
, please visit nongnu.org or mankier.com