I am trying to output a string that represents the current date/time in a format like this "yyyyMMddHHmm". For example, "201310310759" for "7:59am on 10/31/2013".
This is what I have so far:
Date.today.to_formatted_s(:db).gsub("-","")
Use:
Time.now.strftime("%Y%m%d%H%M")
You can check other options here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With