File: formatdate.py

package info (click to toggle)
hyperscan 4.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,676 kB
  • ctags: 17,632
  • sloc: cpp: 126,339; ansic: 34,412; python: 330; sh: 45; makefile: 9
file content (18 lines) | stat: -rwxr-xr-x 354 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import datetime

def usage():
    print("Usage:", os.path.basename(sys.argv[0]), "<seconds from epoch>")

if len(sys.argv) != 2:
    usage()
    sys.exit(1)

ts = sys.argv[1]

build_date = datetime.datetime.utcfromtimestamp(int(ts))

print(build_date.strftime("%Y-%m-%d"))