Community Forums
Results 1 to 2 of 2

Thread: How to create a file with Data and Time information

  1. #1
    Join Date
    Aug 2015
    Posts
    60

    How to create a file with Data and Time information

    Hi all,
    I have and InstallShield 2016 InstallScript MSI project.
    I want to create a file that has timestamp info. For example, myfile_20180212181802.log.

    How can I achieve this from the InstallScript.

    I see there is Data and Time property so I used MsiGetProperty to get Date.
    But Date is in the format for example, 2/12/2018 and windows file names cannot contain slashes.

    Please advise how to create a filename with timestamp info. Basically I need to set a string
    that will contain time such as 20180212181802.

  2. #2
    Join Date
    Jan 2002
    Location
    Probably on a plane somewhere or in a hotel room.
    Posts
    420
    You'll need to parse the Date and Time strings returned into their constituent parts (year, month, day, hour, minute) and then concatenate them back into the desired order.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •