MCPcopy Create free account
hub / github.com/ActiveState/code / DatedString

Function DatedString

recipes/Python/578977_Python_SQLSMO_/recipe-578977.py:141–154  ·  view source on GitHub ↗

Returns dated string with this format 2014_12_30_135857_4581860

()

Source from the content-addressed store, hash-verified

139 return rows
140
141def DatedString():
142 """
143 Returns dated string with this format
144 2014_12_30_135857_4581860
145 """
146
147 from datetime import datetime
148 now = str(datetime.now())
149 now = now.replace('-', '_')
150 now = now.replace(' ', '_')
151 now = now.replace(':', '')
152 now = now.replace('.', '_') + '0'
153
154 return now
155
156
157def BuildTlogSQL(dbname, sourcedb, bkfolder, recovery = 'NORECOVERY', BACKUP_MASK = '_backup_20*.BAK', LOG_MASK = '_backup_20*.TRN'):

Callers 2

recipe-578977.pyFile · 0.85
ActionParsingFunction · 0.85

Calls 2

strFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected