U:RDoc::AnyMethod[iI" strftime:ETI"Time#strftime;TF: publico:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"KFormats _time_ according to the directives in the given format string.;To:RDoc::Markup::BlankLineo; ; [I"8The directives begin with a percent (%) character. ;TI"FAny text not listed as a directive will be passed through to the ;TI"output string.;T@o; ; [ I"8The directive consists of a percent (%) character, ;TI"7zero or more flags, optional minimum field width, ;TI"2optional modifier and a conversion specifier ;TI"as follows:;T@o:RDoc::Markup::Verbatim; [I"+% ;T: @format0o; ; [I" Flags:;To; ; [ I"%- don't pad a numerical output ;TI"_ use spaces for padding ;TI"0 use zeros for padding ;TI"!^ upcase the result string ;TI"# change case ;TI": use colons for %z ;T; 0o; ; [I"9The minimum field width specifies the minimum width.;T@o; ; [I"$The modifiers are "E" and "O". ;TI"They are ignored.;T@o; ; [I"Format directives:;T@o; ; [bI"Date (Year, Month, Day): ;TI"N %Y - Year with century if provided, will pad result at least 4 digits. ;TI"4 -0001, 0000, 1995, 2009, 14292, etc. ;TI"9 %C - year / 100 (rounded down such as 20 in 2009) ;TI" %y - year % 100 (00..99) ;TI" ;TI"4 %m - Month of the year, zero-padded (01..12) ;TI"* %_m blank-padded ( 1..12) ;TI"& %-m no-padded (1..12) ;TI". %B - The full month name (``January'') ;TI"- %^B uppercased (``JANUARY'') ;TI"1 %b - The abbreviated month name (``Jan'') ;TI") %^b uppercased (``JAN'') ;TI" %h - Equivalent to %b ;TI" ;TI"3 %d - Day of the month, zero-padded (01..31) ;TI"& %-d no-padded (1..31) ;TI"4 %e - Day of the month, blank-padded ( 1..31) ;TI" ;TI"' %j - Day of the year (001..366) ;TI" ;TI"-Time (Hour, Minute, Second, Subsecond): ;TI"A %H - Hour of the day, 24-hour clock, zero-padded (00..23) ;TI"B %k - Hour of the day, 24-hour clock, blank-padded ( 0..23) ;TI"A %I - Hour of the day, 12-hour clock, zero-padded (01..12) ;TI"B %l - Hour of the day, 12-hour clock, blank-padded ( 1..12) ;TI"= %P - Meridian indicator, lowercase (``am'' or ``pm'') ;TI"= %p - Meridian indicator, uppercase (``AM'' or ``PM'') ;TI" ;TI"( %M - Minute of the hour (00..59) ;TI" ;TI"* %S - Second of the minute (00..60) ;TI" ;TI"1 %L - Millisecond of the second (000..999) ;TI"L The digits under millisecond are truncated to not produce 1000. ;TI"H %N - Fractional seconds digits, default is 9 digits (nanosecond) ;TI"+ %3N millisecond (3 digits) ;TI"+ %6N microsecond (6 digits) ;TI"* %9N nanosecond (9 digits) ;TI"+ %12N picosecond (12 digits) ;TI", %15N femtosecond (15 digits) ;TI"+ %18N attosecond (18 digits) ;TI", %21N zeptosecond (21 digits) ;TI", %24N yoctosecond (24 digits) ;TI"I The digits under the specified length are truncated to avoid ;TI" carry up. ;TI" ;TI"Time zone: ;TI"F %z - Time zone as hour and minute offset from UTC (e.g. +0900) ;TI"P %:z - hour and minute offset from UTC with a colon (e.g. +09:00) ;TI"O %::z - hour, minute and second offset from UTC (e.g. +09:00:00) ;TI"O %Z - Abbreviated time zone name or similar information. (OS dependent) ;TI" ;TI"Weekday: ;TI"/ %A - The full weekday name (``Sunday'') ;TI", %^A uppercased (``SUNDAY'') ;TI"+ %a - The abbreviated name (``Sun'') ;TI") %^a uppercased (``SUN'') ;TI"0 %u - Day of the week (Monday is 1, 1..7) ;TI"0 %w - Day of the week (Sunday is 0, 0..6) ;TI" ;TI"/ISO 8601 week-based year and week number: ;TI"JThe first week of YYYY starts with a Monday and includes YYYY-01-04. ;TI"HThe days in the year before the first week are in the last week of ;TI"the previous year. ;TI" %G - The week-based year ;TI"> %g - The last 2 digits of the week-based year (00..99) ;TI"8 %V - Week number of the week-based year (01..53) ;TI" ;TI"Week number: ;TI"QThe first week of YYYY that starts with a Sunday or Monday (according to %U ;TI"Gor %W). The days in the year before the first week are in week 0. ;TI"K %U - Week number of the year. The week starts with Sunday. (00..53) ;TI"K %W - Week number of the year. The week starts with Monday. (00..53) ;TI" ;TI"Seconds since the Epoch: ;TI"= %s - Number of seconds since 1970-01-01 00:00:00 UTC. ;TI" ;TI"Literal string: ;TI"# %n - Newline character (\n) ;TI" %t - Tab character (\t) ;TI"$ %% - Literal ``%'' character ;TI" ;TI"Combination: ;TI"+ %c - date and time (%a %b %e %T %Y) ;TI" %D - Date (%m/%d/%y) ;TI"0 %F - The ISO 8601 date format (%Y-%m-%d) ;TI"" %v - VMS date (%e-%^b-%4Y) ;TI" %x - Same as %D ;TI" %X - Same as %T ;TI"' %r - 12-hour time (%I:%M:%S %p) ;TI"! %R - 24-hour time (%H:%M) ;TI"$ %T - 24-hour time (%H:%M:%S) ;T; 0o; ; [I"NThis method is similar to strftime() function defined in ISO C and POSIX.;T@o; ; [ I"PWhile all directives are locale independent since Ruby 1.9, %Z is platform ;TI"dependent. ;TI"OSo, the result may differ even if the same format string is used in other ;TI"systems such as C.;T@o; ; [I" %z is recommended over %Z. ;TI"'%Z doesn't identify the timezone. ;TI"=For example, "CST" is used at America/Chicago (-06:00), ;TI"NAmerica/Havana (-05:00), Asia/Harbin (+08:00), Australia/Darwin (+09:30) ;TI"&and Australia/Adelaide (+10:30). ;TI";Also, %Z is highly dependent on the operating system. ;TI"JFor example, it may generate a non ASCII string on Japanese Windows. ;TI"0i.e. the result can be different to "JST". ;TI"9So the numeric time zone offset, %z, is recommended.;T@o; ; [I"Examples:;T@o; ; [I"Mt = Time.new(2007,11,19,8,37,48,"-06:00") #=> 2007-11-19 08:37:48 -0600 ;TI"Et.strftime("Printed on %m/%d/%Y") #=> "Printed on 11/19/2007" ;TI":t.strftime("at %I:%M%p") #=> "at 08:37AM" ;T; 0o; ; [I"Various ISO 8601 formats:;To; ; ['I"I%Y%m%d => 20071119 Calendar date (basic) ;TI"L%F => 2007-11-19 Calendar date (extended) ;TI"c%Y-%m => 2007-11 Calendar date, reduced accuracy, specific month ;TI"b%Y => 2007 Calendar date, reduced accuracy, specific year ;TI"e%C => 20 Calendar date, reduced accuracy, specific century ;TI"H%Y%j => 2007323 Ordinal date (basic) ;TI"K%Y-%j => 2007-323 Ordinal date (extended) ;TI"E%GW%V%u => 2007W471 Week date (basic) ;TI"H%G-W%V-%u => 2007-W47-1 Week date (extended) ;TI"f%GW%V => 2007W47 Week date, reduced accuracy, specific week (basic) ;TI"i%G-W%V => 2007-W47 Week date, reduced accuracy, specific week (extended) ;TI"F%H%M%S => 083748 Local time (basic) ;TI"I%T => 08:37:48 Local time (extended) ;TI"i%H%M => 0837 Local time, reduced accuracy, specific minute (basic) ;TI"l%H:%M => 08:37 Local time, reduced accuracy, specific minute (extended) ;TI"_%H => 08 Local time, reduced accuracy, specific hour ;TI"s%H%M%S,%L => 083748,000 Local time with decimal fraction, comma as decimal sign (basic) ;TI"v%T,%L => 08:37:48,000 Local time with decimal fraction, comma as decimal sign (extended) ;TI"w%H%M%S.%L => 083748.000 Local time with decimal fraction, full stop as decimal sign (basic) ;TI"z%T.%L => 08:37:48.000 Local time with decimal fraction, full stop as decimal sign (extended) ;TI"b%H%M%S%z => 083748-0600 Local time and the difference from UTC (basic) ;TI"e%T%:z => 08:37:48-06:00 Local time and the difference from UTC (extended) ;TI"b%Y%m%dT%H%M%S%z => 20071119T083748-0600 Date and time of day for calendar date (basic) ;TI"e%FT%T%:z => 2007-11-19T08:37:48-06:00 Date and time of day for calendar date (extended) ;TI"a%Y%jT%H%M%S%z => 2007323T083748-0600 Date and time of day for ordinal date (basic) ;TI"d%Y-%jT%T%:z => 2007-323T08:37:48-06:00 Date and time of day for ordinal date (extended) ;TI"^%GW%V%uT%H%M%S%z => 2007W471T083748-0600 Date and time of day for week date (basic) ;TI"a%G-W%V-%uT%T%:z => 2007-W47-1T08:37:48-06:00 Date and time of day for week date (extended) ;TI"X%Y%m%dT%H%M => 20071119T0837 Calendar date and local time (basic) ;TI"[%FT%R => 2007-11-19T08:37 Calendar date and local time (extended) ;TI"W%Y%jT%H%MZ => 2007323T0837Z Ordinal date and UTC of day (basic) ;TI"Z%Y-%jT%RZ => 2007-323T08:37Z Ordinal date and UTC of day (extended) ;TI"l%GW%V%uT%H%M%z => 2007W471T0837-0600 Week date and local time and difference from UTC (basic) ;TI"n%G-W%V-%uT%R%:z => 2007-W47-1T08:37-06:00 Week date and local time and difference from UTC (extended);T; 0: @fileI" time.c;T:0@omit_headings_from_table_of_contents_below0I"'time.strftime( string ) -> string ;T0[I" (p1);T@ÏFI" Time;TcRDoc::NormalClass00