Skip to content

Instantly share code, notes, and snippets.

@phatblat
Created November 20, 2012 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phatblat/4119062 to your computer and use it in GitHub Desktop.
Save phatblat/4119062 to your computer and use it in GitHub Desktop.
Sqlite command to generate Date in RFC 1123 format
select
case cast (strftime('%w', datetime()) as integer)
when 0 then 'Sun'
when 1 then 'Mon'
when 2 then 'Tue'
when 3 then 'Wed'
when 4 then 'Thu'
when 5 then 'Fri'
else 'Sat' end ||
strftime(', %d ', datetime()) ||
case cast (strftime('%m', datetime()) as integer)
when 1 then 'Jan'
when 2 then 'Feb'
when 3 then 'Mar'
when 4 then 'Apr'
when 5 then 'May'
when 6 then 'Jun'
when 7 then 'Jul'
when 8 then 'Aug'
when 9 then 'Sep'
when 10 then 'Oct'
when 11 then 'Nov'
else 'Dec' end ||
strftime(' %Y %H:%M:%S GMT', datetime()) as formattedDate
from sqlite_master
limit 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment