Ruby’s DateTime class represents calendar dates together with times. Load it with `require 'date'`; create values with constructors such as `DateTime.new`, `DateTime.now`, or `DateTime.parse`. section 8.4 section 8.4.1
DateTime supports common date-and-time operations:
- Query fields such as year, hour, minute, and second, or test the day of the week. section 8.4.2
- Convert to Date or Time; when the target type needs information the source lacks, missing fields are set to zero. section 8.4.4
- Add or subtract days with `+` and `-`, and move by months with `<<` and `>>`. section 8.4.4
>> puts DateTime.new(2009, 1, 2, 3, 4, 5)
2009-01-02T03:04:05+00:00
=> nil
>> puts DateTime.now
2025-10-03T15:45:29-04:00
=> nil
>> puts DateTime.parse("October 23, 1973, 10:34 AM")
1973-10-23T10:34:00+00:00
Compare constructing, getting the current date and time, and parsing a date-time string. section 8.4.1









