You can easily do that by using the strftime method, in this case it would be something like this:
Time.now.strftime("%d/%m/%Y %H:%M")
You can find the complete docs here: http://apidock.com/ruby/DateTime/strftime
More Related Contents:
- Difference between “or” and || in Ruby? [duplicate]
- What is Ruby’s double-colon `::`?
- Using do block vs braces {}
- 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
- Trying to learn / understand Ruby setter and getter methods
- How do I copy a hash in Ruby?
- Is there a “do … while” loop 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
- Is there a performance gain in using single quotes vs double quotes in ruby?
- When is `eval` in Ruby justified?
- How can I install a local gem?
- How to convert a string or integer to binary in Ruby?
- What does to_proc method mean in Ruby?
- What is the easiest way to remove the first character from a string?
- what is “?” in ruby
- When to use ‘self’ in Ruby
- Ruby: Installing rmagick on Ubuntu
- List comprehension in Ruby
- Better ruby markdown interpreter?
- How to understand the difference between class_eval() and instance_eval()?
- What is the best way to split a string to get all the substrings by Ruby?
- Insert digital signature into existing pdf file
- Read and write YAML files without destroying anchors and aliases?