Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Type <attribute> = Date - Issue, posted by Garret Delaronde on Fri Sep 7 18:19:38 2012 
    icon2.gif   Re: Type <attribute> = Date - Issue, posted by David Pilgram on Fri Sep 7 19:08:27 2012 
       icon2.gif   Re: Type <attribute> = Date - Issue, posted by Garret Delaronde on Mon Sep 10 17:18:03 2012 
    icon2.gif   Re: Type <attribute> = Date - Issue, posted by Andreas Luedeke on Wed Sep 12 10:50:40 2012 
Message ID: 67334     Entry time: Wed Sep 12 10:50:40 2012     In reply to: 67331
Icon: Reply  Author: Andreas Luedeke  Author Email: andreas.luedeke@psi.ch 
Category: Bug report  OS: Windows  ELOG Version: 2.9 
Subject: Re: Type <attribute> = Date - Issue 

Garret Delaronde wrote:

 I haven't found anything in the forums about this. Apologies if its a duplicate.

I am fairly familiar with ELog, use it for multiple purposes on 5 different Virtual Servers at work. 

Currently looking to do some updates to one of the instances with the Date Type setting.

We have 17,000 entries all which have had manual entries for a Date Attribute for the last year and 8 months.

Due to regular entry errors on part of our contractors using it, (Eg: using "Aug" instead of "08", or using "-" instead of "/"), I want to change over to using the date type attribute (Type <attribute> = Date).

However the problem i found, the moment i save this in the config, and go to the list of entries, the date has changed on all of the entries to 12/31/1969. Which is BAD for our operation. So after removing the Type Date Setting the dates go back to normal.

Is there anyway to retain those dates so they display as they are and then only new entries would fall under the new date type setting?

Syntax manual didn't help much for this issue.

The problem is, that the existing entries have a string content for this specific attribute.
An attribute with a "date" type content should contain a integer number, which represents the seconds of the epoch (starting with zero on 1-Jan-1970 at 00:00:00).
 
What you need to do is writing a script that reads all *a.log files in the logbook directory and converts lines of the type:
<attribute>: <text>
to lines like
<attribute>: $(date -d "<text>" +%s)
 
Unfortunately elog does not provide you with such a tool.
But since you have to write it now anyway now, you could submit your code to this forum
 
Andreas
ELOG V3.1.5-fe60aaf