Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/date_time.rb

Overview

Adding the to_hl7 method to the ruby Date class.

Instance Method Summary collapse

Instance Method Details

#to_hl7Object

Get a HL7 timestamp (type TS) for a Date instance.

Date.parse('2009-12-02').to_hl7
=> "20091202"


38
39
40
# File 'lib/core_ext/date_time.rb', line 38

def to_hl7
  strftime('%Y%m%d')
end