How to provide a dynamic name to a zip file

  • 13 years ago

    HI,

    Can anybody help me how can I add system date with the name of zipoutput file.

    i am using J# for this code.

    Thanks in Advance. 

     

     

  • 13 years ago

    To create a String from a DateTime you call its ToString method and, optionally, specify the format.  In order to produce the same order both alphabetically and chronologically, it's best to start at the big end.  That means the get just the date:

    myDate.ToString("yyyyMMdd");
    or date and time:
    myDate.ToString("yyyyMMddHHmmss");
    You can then concatenate that string into your file path.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match” - Bill Bryson