--- /dev/null
+## @file\r
+# Get current UTC date and time information and output as ascii code.\r
+#\r
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+#\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+\r
+VersionNumber = '0.1'\r
+import sys\r
+import datetime\r
+import argparse\r
+\r
+def Main():\r
+ PARSER = argparse.ArgumentParser(\r
+ description='Retrieves UTC date and time information (output ordering: year, date, time) - Version ' + VersionNumber)\r
+ PARSER.add_argument('--year',\r
+ action='store_true',\r
+ help='Return UTC year of now. [Example output (2019): 39313032]')\r
+ PARSER.add_argument('--date',\r
+ action='store_true',\r
+ help='Return UTC date MMDD of now. [Example output (7th August): 37303830]')\r
+ PARSER.add_argument('--time',\r
+ action='store_true',\r
+ help='Return 24-hour-format UTC time HHMM of now. [Example output (14:25): 35323431]')\r
+\r
+ ARGS = PARSER.parse_args()\r
+ if len(sys.argv) == 1:\r
+ print ("ERROR: At least one argument is required!\n")\r
+ PARSER.print_help()\r
+\r
+ today = datetime.datetime.utcnow()\r
+ if ARGS.year:\r
+ ReversedNumber = str(today.year)[::-1]\r
+ print (''.join(hex(ord(HexString))[2:] for HexString in ReversedNumber))\r
+ if ARGS.date:\r
+ ReversedNumber = str(today.strftime("%m%d"))[::-1]\r
+ print (''.join(hex(ord(HexString))[2:] for HexString in ReversedNumber))\r
+ if ARGS.time:\r
+ ReversedNumber = str(today.strftime("%H%M"))[::-1]\r
+ print (''.join(hex(ord(HexString))[2:] for HexString in ReversedNumber))\r
+\r
+if __name__ == '__main__':\r
+ Main()\r