Structural time package for jalaali (persian) calendar. This package support parse from string, json and time.
There are three data structures for jalaali:
- Jalaali jalaali date with current system time zone.
- JalaaliTehran jalaali date with Asia/Tehran time zone.
- JalaaliKabul jalaali date with Asia/Kabul time zone.
All structures has following methods for work with date.
Check if date object is empty.
jDate.IsNil()
Set date from standard time object.
jDate.SetTime(time.Now())
Parse date from jalaali date string.
Note: if date is invalid date object will be nil.
jDate.Parse("1400-01-02")
Get current date as standard time. This function return nil if date is empty.
t := jDate.Time()
Get current date as jalaali date object. This function return nil if date is empty.
j := jDate.JTime()
Get current date as standard time object with utc timezone. This function return nil if date is empty.
utcT :=jDate.UTC()
Format jalaali date. This function support standard go time formatting parameters.
f := jDate.Format("2006-01-02")
Get timezone for Asia/Tehran.
Get timezone for Asia/Kabul.
Parse jalaali date string as time. This function use system timezone.
Parse jalaali date string as time for timezone.
Create new jalaali structure from time object. This function use system timezone.
Create new JalaaliTehran structure from time object. This function use Asia/Tehran timezone.
Create new JalaaliKabul structure from time object. This function use Asia/Kabul timezone.