[DOC] Move Time#xmlschema docs to the core (#12403)

This commit is contained in:
Victor Shepelev 2024-12-21 20:06:48 +02:00 committed by GitHub
parent efe671f9d3
commit 78f55ccd9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
Notes: git 2024-12-21 18:07:07 +00:00
Merged-By: zverok <zverok.offline@gmail.com>

21
time.c
View File

@ -5242,6 +5242,27 @@ time_strftime(VALUE time, VALUE format)
}
}
/*
* call-seq:
* xmlschema(fraction_digits=0) -> string
*
* Returns a string which represents the time as a dateTime defined by XML
* Schema:
*
* CCYY-MM-DDThh:mm:ssTZD
* CCYY-MM-DDThh:mm:ss.sssTZD
*
* where TZD is Z or [+-]hh:mm.
*
* If self is a UTC time, Z is used as TZD. [+-]hh:mm is used otherwise.
*
* +fraction_digits+ specifies a number of digits to use for fractional
* seconds. Its default value is 0.
*
* t = Time.now
* t.xmlschema # => "2011-10-05T22:26:12-04:00"
*/
static VALUE
time_xmlschema(int argc, VALUE *argv, VALUE time)
{