Gestionnaire de fichiers - Editer - /opt/cpanel/ea-ruby24/root/usr/share/ri/system/Time/parse-c.ri
Arrière
U:RDoc::AnyMethod[iI" parse:EFI"Time::parse;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FParses +date+ using Date._parse and converts it to a Time object.;To:RDoc::Markup::BlankLine o; ; [I"KIf a block is given, the year described in +date+ is converted by the ;TI"block. For example:;T@o:RDoc::Markup::Verbatim; [I"STime.parse(...) {|y| 0 <= y && y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y} ;T:@format0o; ; [I"OIf the upper components of the given time are broken or missing, they are ;TI"Jsupplied with those of +now+. For the lower components, the minimum ;TI"Dvalues (1 or 0) are assumed if broken or missing. For example:;T@o;; [I"8# Suppose it is "Thu Nov 29 14:33:20 2001" now and ;TI"-# your time zone is EST which is GMT-5. ;TI"2now = Time.parse("Thu Nov 29 14:33:20 2001") ;TI"@Time.parse("16:30", now) #=> 2001-11-29 16:30:00 -0500 ;TI"@Time.parse("7/23", now) #=> 2001-07-23 00:00:00 -0500 ;TI"@Time.parse("Aug 31", now) #=> 2001-08-31 00:00:00 -0500 ;TI"@Time.parse("Aug 2000", now) #=> 2000-08-01 00:00:00 -0500 ;T; 0o; ; [ I"HSince there are numerous conflicts among locally defined time zone ;TI"Fabbreviations all over the world, this method is not intended to ;TI"Eunderstand all of them. For example, the abbreviation "CST" is ;TI"used variously as:;T@o;; [I" -06:00 in America/Chicago, ;TI"-05:00 in America/Havana, ;TI"+08:00 in Asia/Harbin, ;TI"!+09:30 in Australia/Darwin, ;TI"#+10:30 in Australia/Adelaide, ;TI" etc. ;T; 0o; ; [ I"DBased on this fact, this method only understands the time zone ;TI"Iabbreviations described in RFC 822 and the system time zone, in the ;TI"Eorder named. (i.e. a definition in RFC 822 overrides the system ;TI"@time zone definition.) The system time zone is taken from ;TI".<tt>Time.local(year, 1, 1).zone</tt> and ;TI"+<tt>Time.local(year, 7, 1).zone</tt>. ;TI"IIf the extracted time zone abbreviation does not match any of them, ;TI"Bit is ignored and the given time is regarded as a local time.;T@o; ; [I"LArgumentError is raised if Date._parse cannot extract information from ;TI"A+date+ or if the Time class cannot represent specified date.;T@o; ; [I"IThis method can be used as a fail-safe for other parsing methods as:;T@o;; [I"0Time.rfc2822(date) rescue Time.parse(date) ;TI"1Time.httpdate(date) rescue Time.parse(date) ;TI"2Time.xmlschema(date) rescue Time.parse(date) ;T; 0o; ; [I"7A failure of Time.parse should be checked, though.;T@o; ; [I"0You must require 'time' to use this method.;T: @fileI"lib/time.rb;T:0@omit_headings_from_table_of_contents_below00I" year;T[ I"(date, now=self.now);T@NFI" Time;TcRDoc::NormalClass00
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0 |
proxy
|
phpinfo
|
Réglages