Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/core_ext/date_time.rb
Overview
Adding the to_hl7 method to the ruby Date class.
Instance Method Summary collapse
-
#to_hl7 ⇒ Object
Get a HL7 timestamp (type TS) for a Date instance.
Instance Method Details
#to_hl7 ⇒ Object
Get a HL7 timestamp (type TS) for a Date instance.
Date.parse('2009-12-02').to_hl7
=> "20091202"
42 43 44 |
# File 'lib/core_ext/date_time.rb', line 42 def to_hl7 strftime("%Y%m%d") end |