tufte layout files:
[lyx.git] / lib / scripts / date.py
blob23cd79e94324ba2557f961de1fa9429584f494b8
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 # file date.py
5 # This file is part of LyX, the document processor.
6 # Licence details can be found in the file COPYING.
8 # \author Enrico Forestieri
10 # Full author contact details are available in file CREDITS.
12 # Print the system date and time in the given format. See the python
13 # documentation for available formats (mostly the same as the POSIX std).
14 # This file is provided because the date command on Windows is not
15 # POSIX compliant.
17 import sys
18 from time import strftime
20 def main(argv):
21 if len(argv) > 2:
22 sys.stderr.write('Usage: python date.py [<format>]\n')
23 sys.exit(1)
25 if len(argv) == 2:
26 format = argv[1]
27 else:
28 format = "%d-%m-%Y"
30 print strftime(format)
32 if __name__ == "__main__":
33 main(sys.argv)