Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rdfe6dbd55749bab2f8390a241c1ac3df9e918389 -r3498a1f45b1c0dafe4f39e79abbed3e7cd3e1d17 --- shared/scripts/configuration/utility.py (.../utility.py) (revision dfe6dbd55749bab2f8390a241c1ac3df9e918389) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 3498a1f45b1c0dafe4f39e79abbed3e7cd3e1d17) @@ -32,6 +32,7 @@ from dialin.common.msg_ids import MsgIds from dialin.ui.hd_simulator import HDSimulator from dialin.protocols import DenaliMessage, DenaliCanMessenger, DenaliChannels +from datetime import timezone from datetime import datetime CLOUD_CREDENTIALS_LOCATION = '/home/denali/Desktop/cloudsync/credentials' @@ -1066,15 +1067,17 @@ except: test.fail("Log file is not created or log file is not created based on standard log naming format.") -def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M:%S'): + +def get_current_date_and_time_in_utc(date_format='%Y/%m/%d - %H:%M:%S'): """ Method to get current date and time. @input date_format (str) - format of date to be retrieved. @return (str) - date in specified format. """ - date = datetime.now() + date = datetime.now(timezone.utc) return str(date.strftime(date_format)) + def get_extracted_input_buf_file(): """ This function is the handler for getting file from cloudsync folder. @@ -1084,7 +1087,7 @@ @return latest_file - (string) returns latest file that append in cloudsync folder """ try: - current_date = get_current_date_and_time(date_format = "%Y_%m_%d") + current_date = get_current_date_and_time_in_utc(date_format = "%Y_%m_%d") latest_file = '/home/denali/Desktop/sd-card/cloudsync/'+current_date+'_inp.buf' return latest_file except: