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