c14ff78f8c3d3d28efc1189bece369922d71ec72,lib/Toolkit.py,,convertDateToDBFormat,#,103
Before Change
result = time.strptime(string, "%d/%m/%Y")
except:
pass
try:
result = time.strptime(string, "%d/%m/%y")
except:
pass
if result is not None:
result = time.strftime("%Y-%m-%d", result)
return result
After Change
return string.title()
def convertDateToDBFormat(string):
valid_formats = ["%d-%m-%y", "%d/%m/%Y", "%d/%m/%y", "%Y-%m-%d"]
result = None
for valid_format in valid_formats:
try:
result = datetime.strptime(string, valid_format)
except ValueError:
continue
return result
def mergeSearchResults(database, plugins):
if "errors" in database:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: cve-search/cve-search
Commit Name: c14ff78f8c3d3d28efc1189bece369922d71ec72
Time: 2016-06-12
Author: mattoufootu@gmail.com
File Name: lib/Toolkit.py
Class Name:
Method Name: convertDateToDBFormat
Project Name: cryoem/eman2
Commit Name: afd4e3ef1c71c061639171f2f139ada354314593
Time: 2021-02-02
Author: shadowwalkersb@gmail.com
File Name: programs/e2boxer.py
Class Name: boxerTopaz
Method Name: setup_gui
Project Name: nilmtk/nilmtk
Commit Name: a8e6afface0671c36c01d6c3bffb2275d808e97b
Time: 2014-11-27
Author: jack-list@xlk.org.uk
File Name: nilmtk/utils.py
Class Name:
Method Name: dependencies_diagnostics