Skip to content

Instantly share code, notes, and snippets.

@chapeupreto
Last active December 17, 2016 00:02
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 chapeupreto/8a8c828a8327f225fed45c1e99dce97f to your computer and use it in GitHub Desktop.
Save chapeupreto/8a8c828a8327f225fed45c1e99dce97f to your computer and use it in GitHub Desktop.
formata data do padrao EUA para BR
#!/bin/bash
function formata()
{
local data="$1"
local dia="${data:(-2)}"
local mes="${data:5:2}"
local ano="${data:0:4}"
echo "${dia}/${mes}/${ano}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment