Method: CFPropertyList::CFDate.parse_date
- Defined in:
- lib/rbCFTypes.rb
.parse_date(val) ⇒ Object
parse a XML date string
98 99 100 101 102 103 |
# File 'lib/rbCFTypes.rb', line 98 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 |