]> git.lyx.org Git - lyx.git/blob - lib/scripts/date.py
Natbib authoryear uses (Ref1; Ref2) by default.
[lyx.git] / lib / scripts / date.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 # file date.py
5 # This file is part of LyX, the document processor.
6 # Licence details can be found in the file COPYING.
7
8 # \author Enrico Forestieri
9
10 # Full author contact details are available in file CREDITS.
11
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.
16
17 import sys
18 from time import strftime
19
20 def main(argv):
21     if len(argv) > 2:
22         sys.stderr.write('Usage: python date.py [<format>]\n')
23         sys.exit(1)
24
25     if len(argv) == 2:
26         format = argv[1]
27     else:
28         format = "%d-%m-%Y"
29
30     print strftime(format)
31
32 if __name__ == "__main__":
33     main(sys.argv)