Skip to content

Commit

Permalink
Add some missing combinations to Time#strftime
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Oct 21, 2013
1 parent c38dbd5 commit 04aa48d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions corelib/time.rb
Expand Up @@ -202,6 +202,14 @@ def strftime(format = '')
case 'M': return (d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes());
case 'S': return (d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds());
case 's': return d.getTime();
case 'D': return #{`d`.strftime('%m/%d/%y')};
case 'F': return #{`d`.strftime('%Y-%m-%d')};
case 'v': return #{`d`.strftime('%e-%^b-%4Y')};
case 'x': return #{`d`.strftime('%D')};
case 'X': return #{`d`.strftime('%T')};
case 'r': return #{`d`.strftime('%I:%M:%S %p')};
case 'R': return #{`d`.strftime('%H:%M')};
case 'T': return #{`d`.strftime('%H:%M:%S')};
case 'n': return "\\n";
case 't': return "\\t";
case '%': return "%";
Expand Down

0 comments on commit 04aa48d

Please sign in to comment.