Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Sort by date prior to 2002, posted by Chris Jennings on Tue Sep 16 17:59:27 2014 
    icon2.gif   Re: Sort by date prior to 2002, posted by Chris Jennings on Tue Sep 16 18:05:41 2014 
       icon3.gif   Re: Sort by date prior to 2002, posted by Andreas Luedeke on Wed Sep 17 17:45:18 2014 
          icon2.gif   Re: Sort by date prior to 2002, posted by Stefan Ritt on Mon Sep 22 14:39:10 2014 
Message ID: 67706     Entry time: Mon Sep 22 14:39:10 2014     In reply to: 67705
Icon: Reply  Author: Stefan Ritt  Author Email: stefan.ritt@psi.ch 
Category: Info  OS: All  ELOG Version: V2.9.2-24 
Subject: Re: Sort by date prior to 2002 

Andreas Luedeke wrote:

Chris Jennings wrote:

Chris Jennings wrote:

I have an attribute formatted as a date (but not labeled as date) and is sorted as second priority. The sort works fine until I enter a date older than Jan 1st 2002. When I do this it is sorted as the latest. Is this a bug or simply not designed to use dates this old?

Thanks in advance,

Chris

 Sorry, my mistake. The cutoff date is anything before September 9th 2001 does not sort.

I think I remember that this has been discussed earlier: it is a little bug in elogd.
You can see where it comes from if you type in the little command 'date -d "9-Sep-2001 3:46:40" +%s'
Converted to "seconds of the epoche" (seconds since 1970-01-01 00:00:00 UTC) the date "9-Sep-2001 3:46:40" has one digit more than "9-Sep-2001 3:46:39".
Since elog makes a string comparison, suddenly 1'000'000'000 is less than 999'999'999; therefore the wrong sorting.

Workaround: you can modify your old entries and add a leading zero to all entries where your specific date field starts with a '9'.

Stefan: you should fix it at least well before 20-Nov-2286 18:46:40, when the same bug strikes again!

Ok, well before 2286 approaches I fixed that bug and committed it to the GIT repository (master branch).

/Stefan 

ELOG V3.1.5-fe60aaf