Skip to content

Instantly share code, notes, and snippets.

@askinss
Forked from kjwierenga/yesterdate-linux.sh
Created March 27, 2014 15:58
Show Gist options
  • Save askinss/9810880 to your computer and use it in GitHub Desktop.
Save askinss/9810880 to your computer and use it in GitHub Desktop.
> date -d-1day
Mon Sep 6 09:08:43 CEST 2010
> date -d-1day +%Y%m
201009
> date -v-1d
ma 6 sep 2010 09:10:00 CEST
> date -v-1d +%Y%m
201009
require 'date'
puts (Date.today-1).strftime("%Y%m")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment