The timestamp type is not documented. Experimenting a little, it seems that the ruby implementation accepts
- 2000-01-01T10:00:00Z
- 2000-01-01T10:00:00+00:00
but not
- 2000-01-01 10:00:00
- 2000-01-01T10:00:00
- 2000-01-01 10:00:00Z
- '2000-01-01 10:00:00'
- "2000-01-01 10:00:00"
- 2000-01-01 10:00:00+00:00
It is not clear if other formats are also accepted. It also seems that time is a synonym for timestamp, but this is also not documented.
Furthermore, out-of-range values may crash the validator:
- 2000-01-01T26:00:00Z
yields:
/usr/lib/ruby/1.8/yaml.rb:217:in `utc': argument out of range (ArgumentError)
from /usr/lib/ruby/1.8/yaml.rb:217:in `node_import'
from /usr/lib/ruby/1.8/yaml.rb:217:in `load_documents'
from /usr/lib/ruby/1.8/yaml.rb:217:in `each_document'
from /usr/lib/ruby/1.8/yaml.rb:232:in `load_documents'
from /usr/lib/ruby/1.8/kwalify/main.rb:299:in `_validate_files'
from /usr/lib/ruby/1.8/kwalify/main.rb:267:in `each'
from /usr/lib/ruby/1.8/kwalify/main.rb:267:in `_validate_files'
from /usr/lib/ruby/1.8/kwalify/main.rb:215:in `validate_files'
from /usr/lib/ruby/1.8/kwalify/main.rb:111:in `execute'
from /usr/lib/ruby/1.8/kwalify/main.rb:124:in `main'
from /usr/bin/kwalify:13
Regards,
Slaven
I haven't found anything that validate as timestamp. The above positive examples don't in Kwalify 0.7.1.
None of the canonical timestamps in the YAML spec do either,
http://www.yaml.org/spec/1.2/spec.html