strftime

Introduction

The strftime format is the standard date formatting for UNIX. It's used in C, Ruby, and more.

Presets

Date

ExampleOutput
%m/%d/%Y06/05/2013
%A, %B %e, %YWednesday, June 5, 2013
%F2013-06-05
%b %e %aJun 5 Wed

Time

ExampleOutput
%H:%M23:05
%I:%M %p11:05 PM
%T23:05:00

Used by Ruby, UNIX date, and many more.

See: strftime

Date

SymbolExampleArea
%aSunWeekday
%ASunday 
%w0..6 (Sunday is 0) 
%y13Year
%Y2013 
%bJanMonth
%BJanuary 
%m01..12 
%d01..31Day
%e1..31 

See: strftime

Time

SymbolExampleArea
%l1Hour
%H00..2324h hour
%I01..1212h hour
%M00..59Minute
%S00..60Second
%pAMAM or PM
%ZUTCZone name
%z+0000Numeric offset
%j001..366Day of the year
%s1370473500Epoch seconds
%%%Literal % character

See: strftime

0 Comments for this cheatsheet. Write yours!