File: formatdate.py

package info (click to toggle)
hyperscan 5.4.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,304 kB
  • sloc: cpp: 143,324; ansic: 41,041; python: 621; sh: 32; makefile: 12
file content (18 lines) | stat: -rwxr-xr-x 354 bytes parent folder | download | duplicates (6)
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"))