require 'time'
require 'date'
t = Time.now
d = DateTime.now
dd = DateTime.parse(t.to_s)
tt = Time.parse(d.to_s)
More Related Contents:
- Difference between DateTime and Time in Ruby
- Can Ruby print out time difference (duration) readily?
- How to convert a unix timestamp (seconds since epoch) to Ruby DateTime?
- Ruby / Rails – Change the timezone of a Time, without changing the value
- Set time zone offset in Ruby
- how to convert 270921sec into days + hours + minutes + sec ? (ruby)
- How to generate a random string in Ruby
- Code block passed to each works with brackets but not with ‘do’-‘end’ (ruby)
- Array#each vs. Array#map
- How do I copy a hash in Ruby?
- what is the functionality of “&: ” operator in ruby? [duplicate]
- Ruby Array Initialization [duplicate]
- What does ‘Monkey Patching’ exactly Mean in Ruby?
- Using ‘return’ in a Ruby block
- Ruby regular expression using variable name
- Best way to convert strings to symbols in hash
- When is `eval` in Ruby justified?
- How can I install a local gem?
- What does to_proc method mean in Ruby?
- How do you downgrade rubygems?
- How to search a folder and all of its subfolders for files of a certain type
- Why are gems installed in a directory with a different Ruby version than I’m running?
- GPS Time Representation library
- Shortcut to make case/switch return a value
- What is a regex to match a string NOT at the end of a line?
- How do I format a date in ruby to include “rd” as in “3rd”
- Interpolating a string into a regex
- Better ruby markdown interpreter?
- Understanding Ruby and OS I/O buffering
- Rake “already initialized constant WFKV_” warning