AnsweredAssumed Answered

Timestamp a Zipfile File Name?

Question asked by jpilbeam Champion on Feb 7, 2018
Latest reply on Feb 8, 2018 by jpilbeam

Using PythonWin 2.7.10, I would like to append a date to a bunch of zipfiles in a folder. I've been using the time module which prints the current month, day and year. But, I'm not sure how to append this date to the end of my zipfiles' file name. In this case I've been running tests on the file, which contains a shapefile.


This script seems to work, but it creates an odd looking file with no content:

import time
import arcpy
from arcpy import env

ws = arcpy.env.workspace = r'\\gisfile\GISstaff\Jared'

current_time = time.strftime("%m%d%Y")
output_name = "" + current_time
output_file = open(ws + output_name, "w")
print current_time


Here's how the file was named:  JaredWillCounty_PLSS.zip02072018


EDIT: What do I need to do to have the look like this: