[
  {
    "Id": "518049",
    "ThreadId": "233713",
    "Html": "\r\n<p>Newbie VB learner here. Sorry for the easy question.</p>\r\n<p>How can I add dates to the zip files name?</p>\r\n<p>I know it has to be something in here:</p>\r\n<p>zip.save(&quot;testfileDDMMYY.zip&quot;)</p>\r\n<p>Thanks in advance.</p>\r\n",
    "PostedDate": "2010-11-05T20:47:11.5-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "518110",
    "ThreadId": "233713",
    "Html": "\r\n<p>Well, sure.&nbsp; If you want the zipfile to have a specific name, then use that specific name when calling zip.Save(&quot;FileNameGoesHere.zip&quot;)</p>\r\n<p>maybe you are really asking, how can I format a string with the current date.&nbsp; In that case, what you want is something like this:</p>\r\n<p>Dim filename as String<br>\r\nfilename = String.Format(&quot;BaseName-{0}.zip&quot;, DateTime.Now.ToString(&quot;YYMMDD&quot;))<br>\r\nzip.Save(filename)</p>\r\n<p>Read the reference documentation on DateTime for more details.</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-11-06T03:21:00.087-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "518466",
    "ThreadId": "233713",
    "Html": "\r\n<p>Thanks for the tips. I tried your code but resulting file name shows up as &quot;BaseName-YY11DD.zip&quot;</p>\r\n<p>I tried to search &quot;DateTime&quot; in the reference documentation but the closest that I can find is at Reference -&gt; Ionic.zip -&gt; ZipEntry -&gt; SetEntryTimes(DateTime, Datetime, Datetime)</p>\r\n<p>Is that what you are referring to?</p>\r\n",
    "PostedDate": "2010-11-07T13:23:36.407-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "518475",
    "ThreadId": "233713",
    "Html": "\r\n<p>whoops - convert that code to this:</p>\r\n<p>filename = String.Format(&quot;BaseName-{0}.zip&quot;, DateTime.Now.ToString(&quot;yyyyMMdd&quot;))</p>\r\n<p>(case is significant).</p>\r\n<p>You asked about SetEntryTimes().... No, that's not what I was referring to.&nbsp; I was referring to\r\n<a href=\"http://msdn.microsoft.com/en-us/library/system.datetime.aspx\">the System.DateTime&nbsp;structure</a> - part of the class library that is built-in to .NET.&nbsp;&nbsp; This structure provides a way to get the current time (DateTime.Now) and also a way\r\n to convert the DateTime value to a string (DateTime.ToString()).&nbsp;&nbsp; Combining those gets you what you want.</p>\r\n<p>Regarding SetEntryTimes() - this is a method that allows you to set times on the zip entries within the zip file.&nbsp; I don't think you want to fiddle with the date and time on the entries within the zip file, if I understood your original request correctly.&nbsp;&nbsp;What\r\n you want is the current date and time - and you want to use that to build the name of the zip file.&nbsp; I think.&nbsp; If you&nbsp;use the line I provided above, it should work.</p>\r\n<p>I should say: yours is really not a question about DotNetZip; it's about the DateTime class, or more to the point, how to get the current time in a VB.NET application, and then use it to create a filename.</p>\r\n<p>good luck.</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-11-07T13:53:01.14-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "518479",
    "ThreadId": "233713",
    "Html": "\r\n<p>Works as recommeded! You are right. It is more like a VB.NET question. Sorry about that. I believe that I do have a DotNetZip question coming but I will open a new tread for that. Thanks!</p>\r\n",
    "PostedDate": "2010-11-07T13:59:51.373-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]