Skip to content

Instantly share code, notes, and snippets.

@bugduino
Last active December 24, 2015 20:29
Show Gist options
  • Save bugduino/6857892 to your computer and use it in GitHub Desktop.
Save bugduino/6857892 to your computer and use it in GitHub Desktop.
epoch_to_YYYY-MM-DD (seconds) ->
if seconds != null
date = new Date(0)
date.setSeconds(seconds)
yyyy = date.getFullYear()
mm = date.getMonth() + 1
dd = date.getDate()
if dd < 10
dd = "0" + dd
if mm < 10
mm = "0" + mm
yyyy + "-" + mm + "-" + dd
else ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment