slashmili / python-jalali

Jalali calendar binding for Python based on Python's datetime module
http://pypi.python.org/pypi/jdatetime/
Other
339 stars 47 forks source link

printing literal %s #83

Closed davoudarsalani closed 3 years ago

davoudarsalani commented 3 years ago

I was trying different formats and I found that print(jdatetime.datetime.now().strftime("%s")) prints literal %s instead of 1620108348.

farzadghanei commented 3 years ago

@davoudarsalani thanks for your interest in the project. %s is not implemented as a format code in jdatetime.

It doesn't seem to be a documented format code in standard library:

If a Unix timestamp is needed, the timestamp method provides the value:

>>> jdatetime.datetime.now().timestamp()
1620135794.377304