Golang implementation of Jalaali JS and Jalaali Python implementations of Jalaali (Jalali, Persian, Khayyami, Khorshidi, Shamsi) convertion to Gregorian calendar system and vice-versa.
This implementation is based on an algorithm by Kazimierz M. Borkowski. Borkowski claims that this algorithm works correctly for 3000 years!
Documentation on API is available here at Go official documentation site.
Use go get on this repository:
$ go get -u github.com/jalaali/go-jalaali- Wrapper around Golang time package:
- Call
Jalaali.Now()to get instance of current time. You can use all function fromtimepackage with this wrapper. - Call
Jalaali.From(t)and pass atimeinstance to it. The you can work with it the same way you work withtimepackage.
- Call
- Jalaali Formatting:
- Call
JFormatmethod of a Jalaali instance and pass it the same formatting options that is used for Golangtimepackage. The output will be in Jalaali date and use persian digits and words.
- Call