Returns true if the date is Sunday.
Returns true if the date is Monday.
Returns true if the date is Tuesday.
Returns true if the date is Wednesday.
Returns true if the date is Thursday.
Returns true if the date is Friday.
Returns the Julian day number denoting the day of calendar reform.
Date.new(2001,2,3).start #=> 2299161.0 Date.new(2001,2,3,Date::GREGORIAN).start #=> -Infinity
This method is equivalent to new_start
(Date::ITALY
).
Creates a new Time
object with the value given by time
, the given number of seconds_with_frac
, or seconds
and microseconds_with_frac
since the Epoch. seconds_with_frac
and microseconds_with_frac
can be an Integer
, Float
, Rational
, or other Numeric
. non-portable feature allows the offset to be negative on some systems.
If a numeric argument is given, the result is in local time.
Time.at(0) #=> 1969-12-31 18:00:00 -0600 Time.at(Time.at(0)) #=> 1969-12-31 18:00:00 -0600 Time.at(946702800) #=> 1999-12-31 23:00:00 -0600 Time.at(-284061600) #=> 1960-12-31 00:00:00 -0600 Time.at(946684800.2).usec #=> 200000 Time.at(946684800, 123456.789).nsec #=> 123456789
Returns the day of the month (1..n) for time.
t = Time.now #=> 2007-11-19 08:27:03 -0600 t.day #=> 19 t.mday #=> 19
Returns the day of the month (1..n) for time.
t = Time.now #=> 2007-11-19 08:27:03 -0600 t.day #=> 19 t.mday #=> 19
Returns an integer representing the day of the week, 0..6, with Sunday == 0.
t = Time.now #=> 2007-11-20 02:35:35 -0600 t.wday #=> 2 t.sunday? #=> false t.monday? #=> false t.tuesday? #=> true t.wednesday? #=> false t.thursday? #=> false t.friday? #=> false t.saturday? #=> false
Returns an integer representing the day of the year, 1..366.
t = Time.now #=> 2007-11-19 08:32:31 -0600 t.yday #=> 323
Returns true
if time represents Sunday.
t = Time.local(1990, 4, 1) #=> 1990-04-01 00:00:00 -0600 t.sunday? #=> true
Returns true
if time represents Monday.
t = Time.local(2003, 8, 4) #=> 2003-08-04 00:00:00 -0500 p t.monday? #=> true
Returns true
if time represents Tuesday.
t = Time.local(1991, 2, 19) #=> 1991-02-19 00:00:00 -0600 p t.tuesday? #=> true
Returns true
if time represents Wednesday.
t = Time.local(1993, 2, 24) #=> 1993-02-24 00:00:00 -0600 p t.wednesday? #=> true
Returns true
if time represents Thursday.
t = Time.local(1995, 12, 21) #=> 1995-12-21 00:00:00 -0600 p t.thursday? #=> true
Returns true
if time represents Friday.
t = Time.local(1987, 12, 18) #=> 1987-12-18 00:00:00 -0600 t.friday? #=> true
Returns pathname configuration variable using fpathconf().
name should be a constant under Etc
which begins with PC_
.
The return value is an integer or nil. nil means indefinite limit. (fpathconf() returns -1 but errno is not set.)
require 'etc' IO.pipe {|r, w| p w.pathconf(Etc::PC_PIPE_BUF) #=> 4096 }