Method: CFPropertyList::CFDate.parse_date
- Defined in:
- lib/cfpropertylist/rbCFTypes.rb
.parse_date(val) ⇒ Object
parse a XML date string
155 156 157 158 159 160 |
# File 'lib/cfpropertylist/rbCFTypes.rb', line 155 def CFDate.parse_date(val) # 2009-05-13T20:23:43Z val =~ %r{^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$} year,month,day,hour,min,sec = $1, $2, $3, $4, $5, $6 return Time.utc(year,month,day,hour,min,sec).getlocal end |