× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Ruby time format for timestamp in a filename

Josh Shupack
Dec 17, 2014
<pre><code>Time.now.strftime('</code>%Y-<code>%m-%d_%H-%M-%S')</code></pre><p>This will output something like:</p><p>'2014-12-16_17-42-49'</p><p>which is suitable for adding to a filename</p>

Get New Tutorials Delivered to Your Inbox

New tutorials will be sent to your Inbox once a week.

comments powered by Disqus