HOME | SOLUTIONS | INDUSTRIES | SERVICES | ABOUT US | NEWS & EVENTS | SUPPORT CENTER | CONTACT

 
Product Documentation
Dovetail SelfService
Knowledge Base
Support Forums
Employee Blogs
Contact Us

Corrupt date format in DIET archive files (Article # 262)

View products that this article applies to.

Problem:

When performing a purge, archive, or export using DIET, and explicitly setting a date_format, the resulting dates in the output file can be corrupt.

For example, using this diet command:
diet -archive -dir acd.dir -export acd.dat -date_format "%d/%m/%Y %H:%M:%S"

can result in the output file having entries such as:
creation_time = DATE "m/H:S";

In the output file, the DATE_FORMAT is listed as:
DATE_FORMAT "m/H:S"

This happens when running DIET on Windows.

Resolution:

If you run the command from a DOS command line, everything works as expected.
However, if you place the command in a BAT file, and then run the BAT file, the date format in the output file is corrupt.

This is because DOS interprets certain characters, and the percent sign (%) is one of them.

So, if the following command is placed in a BAT file:
diet -archive -dir acd.dir -export acd.dat -date_format "%d/%m/%Y %H:%M:%S"

Then the actual command being executed will be:
diet -archive -dir acd.dir -export acd.dat -date_format "m/H:S"

Notice that the date_format has been interpreted by DOS, which is undesired.

In order for this to function as desired, simply use two percent signs instead of one. Example:
diet  -archive -dir acd.dir -export gc.dat -date_format "%%d/%%m/%%Y %%H:%%M:%%S"

This way, the actual command being executed will be:
diet -archive -dir acd.dir -export acd.dat -date_format "%d/%m/%Y %H:%M:%S"

Applies To:

  • ArchiveManagerDovetail ArchiveManager (formerly Data Import Export Tool)

Copyright © 2008 Dovetail Software, Inc. All rights reserved.

 

support center | blogs | terms & conditions | contact