Class: DateTime

Inherits:
Object
  • Object
show all
Defined in:
lib/parsi-datetime.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parsi(year = 0, month = 1, day = 1, hour = 0, minute = 0, second = 0, zone = "00:00") ⇒ Object Also known as: jalali

Creates a DateTime object corresponding to the specified Jalali Date (year, month and day) and time (hour, minute and second) in given zone.


189
190
191
# File 'lib/parsi-datetime.rb', line 189

def parsi year=0, month=1, day=1, hour=0, minute=0, second=0, zone="00:00"
  Parsi::DateTime.civil year, month, day, hour, minute, second, zone
end

Instance Method Details

#to_parsiObject Also known as: jalali, to_jalali, to_persian

Returns a Parsi::DateTime object representing same date in Jalali calendar


196
197
198
# File 'lib/parsi-datetime.rb', line 196

def to_parsi
  Parsi::DateTime.new! ajd, offset
end