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' ## defaultThere are ten options for source:
- Use docker image
docker-khayyamwill pullkhayyamdocker image/repository (about 61.3MB in size) containingkhayyampython module on Alpine Linuxdocker-persiantoolswill pullpersiantoolsdocker image/repository (about 60.8MB in size) containingpersiantoolspython module on Alpine Linuxdocker-jdatetimewill pulljdatetimedocker image/repository (about 59.8MB in size) containingjdatetimepython module on Alpine Linuxdocker-jdatewill pulljdatedocker image/repository (about 8.22MB in size) containingjdateon Alpine Linux
- Download tar.gz file
askapachewill download from askapache.comgnuwill download from gnu.orgnongnuwill download from nongnu.org
- Clone git repository
clone-githubwill clone from github.comclone-gnuwill clone from gnu.orgclone-nongnuwill 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 thedatetimemodule: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:
jdateanddateshare the same format.
- Jalali Calendar homepage: gnu.org and nongnu.org
- To get more versions/tags of
khayyam/persiantools/jdatetime/jdatedocker images/repositories, please visit docker.com - To install
khayyampython module, please visit pypi.org or dobisel.com - To install
persiantoolspython module, please visit pypi.org or github.com - To install
jdatetimepython module, please visit pypi.org or github - To download
jcalin tar.gz, please visit askapache.com, gnu.org or nongnu.org - To clone
jcalrepository, please visit github.com, gnu.org or nongnu.org - For instructions on how to manually download and install
jcal/jdatelocally, please visit wiki.ubuntu.ir or wiki.ubuntu.ir - For instructions on how to use
jcal/jdate, please visit nongnu.org or mankier.com