⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Time
/
View File Name :
cdesc-Time.ri
U:RDoc::NormalClass[iI" Time:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[ : @fileI""ext/json/lib/json/add/time.rb;T:0@omit_headings_from_table_of_contents_below0o;;[ ; I"lib/time.rb;T; 0o;;[Io:RDoc::Markup::Paragraph;[I"MTime is an abstraction of dates and times. Time is stored internally as ;TI"=the number of seconds with subsecond since the _Epoch_, ;TI"1970-01-01 00:00:00 UTC.;To:RDoc::Markup::BlankLine o;;[ I"The Time class treats GMT ;TI"O(Greenwich Mean Time) and UTC (Coordinated Universal Time) as equivalent. ;TI"OGMT is the older way of referring to these baseline times but persists in ;TI")the names of calls on POSIX systems.;T@o;;[ I"NAll times may have subsecond. Be aware of this fact when comparing times ;TI"Nwith each other -- times that are apparently equal when displayed may be ;TI"different when compared. ;TI"9(Since Ruby 2.7.0, Time#inspect shows subsecond but ;TI"-Time#to_s still doesn't show subsecond.);T@o;;[I"ISince Ruby 1.9.2, Time implementation uses a signed 63 bit integer, ;TI"Bignum or Rational. ;TI"HThe integer is a number of nanoseconds since the _Epoch_ which can ;TI")represent 1823-11-12 to 2116-02-20. ;TI"EWhen Bignum or Rational is used (before 1823, after 2116, under ;TI"
2002-01-01 00:00:00 -0500 ;TI":Time.new(2002, 10) #=> 2002-10-01 00:00:00 -0500 ;TI":Time.new(2002, 10, 31) #=> 2002-10-31 00:00:00 -0500 ;T:@format0o;;[I"You can pass a UTC offset:;T@o;;[I"MTime.new(2002, 10, 31, 2, 2, 2, "+02:00") #=> 2002-10-31 02:02:02 +0200 ;T;0o;;[I"Or a timezone object:;T@o;;[I"Ctz = timezone("Europe/Athens") # Eastern European Time, UTC+2 ;TI"GTime.new(2002, 10, 31, 2, 2, 2, tz) #=> 2002-10-31 02:02:02 +0200 ;T;0o;;[I"7You can also use Time.local and Time.utc to infer ;TI"Alocal and UTC timezones instead of using the current system ;TI" setting.;T@o;;[I"LYou can also create a new time using Time.at which takes the number of ;TI".seconds (with subsecond) since the {Unix ;TI"5Epoch}[https://en.wikipedia.org/wiki/Unix_time].;T@o;;[I"6Time.at(628232400) #=> 1989-11-28 00:00:00 -0500 ;T;0S; ;i;I"%Working with an instance of Time;T@o;;[I"NOnce you have an instance of Time there is a multitude of things you can ;TI"Pdo with it. Below are some examples. For all of the following examples, we ;TI"Bwill work on the assumption that you have done the following:;T@o;;[I"4t = Time.new(1993, 02, 24, 12, 0, 0, "+09:00") ;T;0o;;[I"Was that a monday?;T@o;;[I"t.monday? #=> false ;T;0o;;[I"What year was that again?;T@o;;[I"t.year #=> 1993 ;T;0o;;[I")Was it daylight savings at the time?;T@o;;[I"t.dst? #=> false ;T;0o;;[I"!What's the day a year later?;T@o;;[I"6t + (60*60*24*365) #=> 1994-02-24 12:00:00 +0900 ;T;0o;;[I"4How many seconds was that since the Unix Epoch?;T@o;;[I"t.to_i #=> 730522800 ;T;0o;;[I"?You can also do standard functions like compare two times.;T@o;;[I"t1 = Time.new(2010) ;TI"t2 = Time.new(2011) ;TI" ;TI"t1 == t2 #=> false ;TI"t1 == t1 #=> true ;TI"t1 < t2 #=> true ;TI"t1 > t2 #=> false ;TI" ;TI"4Time.new(2010,10,31).between?(t1, t2) #=> true ;T;0S; ;i;I"Timezone argument;T@o;;[I"EA timezone argument must have +local_to_utc+ and +utc_to_local+ ;TI">methods, and may have +name+, +abbr+, and +dst?+ methods.;T@o;;[I"FThe +local_to_utc+ method should convert a Time-like object from ;TI"Cthe timezone to UTC, and +utc_to_local+ is the opposite. The ;TI"Hresult also should be a Time or Time-like object (not necessary to ;TI"Cbe the same class). The #zone of the result is just ignored. ;TI"HTime-like argument to these methods is similar to a Time object in ;TI"DUTC without subsecond; it has attribute readers for the parts, ;TI"He.g. #year, #month, and so on, and epoch time readers, #to_i. The ;TI"Bsubsecond attributes are fixed as 0, and #utc_offset, #zone, ;TI"A#isdst, and their aliases are same as a Time object in UTC. ;TI"3Also #to_time, #+, and #- methods are defined.;T@o;;[I"EThe +name+ method is used for marshaling. If this method is not ;TI"Ddefined on a timezone object, Time objects using that timezone ;TI")object can not be dumped by Marshal.;T@o;;[I"4The +abbr+ method is used by '%Z' in #strftime.;T@o;;[I"OThe +dst?+ method is called with a +Time+ value and should return whether ;TI">the +Time+ value is in daylight savings time in the zone.;T@S; ;i;I" Auto conversion to Timezone;T@o;;[I"PAt loading marshaled data, a timezone name will be converted to a timezone ;TI"Fobject by +find_timezone+ class method, if the method is defined.;T@o;;[I"OSimilarly, that class method will be called when a timezone argument does ;TI"4not have the necessary methods mentioned above.;T; I"time.c;T; 0; 0; 0[ [ [[I"Comparable;To;;[ ; @µ; 0I"time.c;T[[I" class;T[[:public[[I"at;T@½[I"gm;T@½[I" httpdate;TI"lib/time.rb;T[I"iso8601;T@Ê[I"json_create;TI""ext/json/lib/json/add/time.rb;T[I" local;T@½[I"mktime;T@½[I"new;T@½[I"now;T@½[I" parse;T@Ê[I"rfc2822;T@Ê[I"rfc822;T@Ê[I" strptime;T@Ê[I"utc;T@½[I"xmlschema;T@Ê[I"zone_offset;T@Ê[:protected[ [:private[ [I"apply_offset;T@Ê[I"force_zone!;T@Ê[I"make_time;T@Ê[I"month_days;T@Ê[I"zone_utc?;T@Ê[I" instance;T[[;[F[I"+;T@½[I"-;T@½[I"<=>;T@½[I"as_json;T@Ï[I"asctime;T@½[I" ceil;T@½[I" ctime;T@½[I"day;T@½[I" dst?;T@½[I" eql?;T@½[I" floor;T@½[I"friday?;T@½[I" getgm;T@½[I" getlocal;T@½[I"getutc;T@½[@Ç@½[I" gmt?;T@½[I"gmt_offset;T@½[I"gmtime;T@½[I"gmtoff;T@½[I" hash;T@½[I" hour;T@½[I" httpdate;T@Ê[I"inspect;T@½[I" isdst;T@½[I"iso8601;T@Ê[I"localtime;T@½[I" mday;T@½[I"min;T@½[I"mon;T@½[I"monday?;T@½[I" month;T@½[I" nsec;T@½[I"rfc2822;T@Ê[I"rfc822;T@Ê[I" round;T@½[I"saturday?;T@½[I"sec;T@½[I" strftime;T@½[I"subsec;T@½[I"sunday?;T@½[I"thursday?;T@½[I" to_a;T@½[I"to_date;TI"ext/date/date_core.c;T[I"to_datetime;T@P[I" to_f;T@½[I" to_i;T@½[I"to_json;T@Ï[I" to_r;T@½[I" to_s;T@½[I"to_time;T@P[I" tuesday?;T@½[I"tv_nsec;T@½[I"tv_sec;T@½[I"tv_usec;T@½[I" usec;T@½[I"utc;T@½[I" utc?;T@½[I"utc_offset;T@½[I" wday;T@½[I"wednesday?;T@½[I"xmlschema;T@Ê[I" yday;T@½[I" year;T@½[I" zone;T@½[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0; 0[ I"ext/date/date_core.c;T@ I"lib/cgi/session.rb;T@@µ@µcRDoc::TopLevel