File Description log date: field fragged

Technical support and discussion of Newsbin Version 6 series.

File Description log date: field fragged

Postby harsh » Fri Jan 03, 2014 9:21 pm

In Options->Options->file description->log date:, the date field worked fine until I installed 6.50. Now, rather than a date field that is annoyingly dependent on one's Windows locale preferences (a change that was not much appreciated by me), it appends whatever the display (^T toggle) is set to. My system was set (for whatever reason) to show the post age in the grid and that's what's showing up in the descript.ion file instead of the post time stamp. I now know how to work around this but it will be a PITA to fix all the stuff I downloaded since I upgraded.

I'm hoping this wasn't intentional as recording the post age is relatively useless without some serious (and decidedly imprecise) date arithmetic.

I wrote a program that parses the description file and, among other things, sets the file creation and modification time stamps to the post time stamp so having the format change occasionally (and seemingly without warning) is a problem.
harsh
n00b
n00b
 
Posts: 8
Joined: Sat Oct 18, 2008 4:44 pm

Registered Newsbin User since: 12/30/07

Re: File Description log date: field fragged

Postby Quade » Sat Jan 04, 2014 12:06 am

I don't use it so, I tend not to test it. If someone had mentioned something during the beta I probably could have fixed it then. I'll wrote a note to look at it.

There's no kind of standard for the date and time. I don't remember if it's the post date or the download date. I think it's the posting date. I imagine what happens is when I change the code to display the date in the post list, the description code just inherits the change.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44984
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: File Description log date: field fragged

Postby harsh » Sat Jan 04, 2014 4:29 pm

The NewsBin Log Date: that is saved to the descript.ion appears to be defined as the Date: field of the post (derived from a careful parsing of the dialog box text). I'm good with what ever it is as long as it doesn't change from one release to the next. I had changed my Windows locale to format the date in MySQL style (for NewsBin 6.4x) format but the RFC specified format would work as well.

Quade wrote:There's no kind of standard for the date and time.
The date-time format is defined in RFC 5322:

date-time = [ day-of-week "," ] date time [CFWS]
day-of-week = ([FWS] day-name) / obs-day-of-week
day-name = "Mon" / "Tue" / "Wed" / "Thu" /
"Fri" / "Sat" / "Sun"
date = day month year
day = ([FWS] 1*2DIGIT FWS) / obs-day
month = "Jan" / "Feb" / "Mar" / "Apr" /
"May" / "Jun" / "Jul" / "Aug" /
"Sep" / "Oct" / "Nov" / "Dec"
year = (FWS 4*DIGIT FWS) / obs-year
time = time-of-day zone
time-of-day = hour ":" minute [ ":" second ]
hour = 2DIGIT / obs-hour
minute = 2DIGIT / obs-minute
second = 2DIGIT / obs-second
zone = (FWS ( "+" / "-" ) 4DIGIT) / obs-zone

If I posted something at 1:37:15pm my time today, it would show up with a date of "Sat, 04 Jan 2014 13:37:15 -0800"

Interestingly, the NewsBin displayed time stamp is off by one hour on my Windows XP system. Something that was posted at 19:37:02 -0600 is showing a date of 18:37 in PST time zone (should be 17:37; ideally 17:37:02). I suspect that this may be a bailout as a result of the abomination that is the way that XP and earlier handled DST (it concealed a change of time zone).

The article age is correct!

The NewsBin 4.x date format was "month day time-of-day year" had the correct elements in a rather peculiar, but eminently consistent, order.

Quade wrote: I imagine what happens is when I change the code to display the date in the post list, the description code just inherits the change.
This is a new behavior (as was the locale formatting of the date in v6.4) and I would suggest that a viewing toggle in the post list should not impact the output of the logging function.

If your resources were infinite, my preference for the Log Date: would be to have it convert the Date: from the post to my local time (since this appears to have been done at some level in previous releases). My second choice would be to copy it directly from the Date: field of the post.

The utility that I spoke of earlier inserts a record of each download into a MySQL database along with some CRCs. Being able to parse the descript.ion file is important to me.
harsh
n00b
n00b
 
Posts: 8
Joined: Sat Oct 18, 2008 4:44 pm

Registered Newsbin User since: 12/30/07

Re: File Description log date: field fragged

Postby Quade » Sat Jan 04, 2014 6:00 pm

There's no kind of standard for the date and time.


I'm not saying there's no standard. I'm saying I'm not applying any standard to that field. It's probably just a windows time format function that spits out a text field. The generated format will change with your windows display options to match the local. There's no requirement for me to generate any specific format for the descript.ion so, it's sort of "whatever looks ok and nobody complains about".

My second choice would be to copy it directly from the Date: field of the post.


This text no longer exists. All post timestamps are converted to time_t's meaning they have to be translated back to text for display.

DownloadedFiles.txt

Have you looked at this file in the data folder? It's sort of a centralized description file.

Downloaded.db3 is a good place to look too. You could extract all the file download information from this file. The time is already in time_t's so, you could change them into anything you want. The descript.ion files are all afterthoughts. They get no testing and only get fixes when people complain. The other files are more consistent. Just recently, downloaded.db3 doesn't purge old files anymore. It grows until someone deletes or moves files.


I'm not suggesting I won't look at the descript.ion, I will. Just that it's not the most stable thing to depend on.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44984
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: File Description log date: field fragged

Postby harsh » Sat Jan 11, 2014 12:15 pm

Quade wrote:Downloaded.db3 is a good place to look too. You could extract all the file download information from this file.
There are two tables in Downloaded.db3 and the FilesTab_V3 table (with stale data in it) appears closer to what I need. Unfortunately, it looks like 6.5 uses the FilesTab_V6 table that tracks the questionably useful FT_FileDownloadDate (presumably close to the time stamp on the file?) versus the FT_DateAdded from FilesTab_V3 that I assume to be something closer to the Usenet insertion date (what I'm looking for out to the second).

The various time stamps and ages as produced on screen (and therefore in the logging files) by NewsBin are truncated or rounded (I'm not sure which) to the minute which perturbs my efforts.

For anyone following this conversation the relevant SQLite query language to convert time_t to YYYY-MM-DD HH:MM:SS (ISO-like format) is: datetime(time_t, 'unixepoch', 'localtime'). You can omit the 'localtime' parameter to give you zulu time.

On a related topic, is there any way to freeze the ^T toggle so that NewsBin grid opens with the insertion date as opposed to the age?
harsh
n00b
n00b
 
Posts: 8
Joined: Sat Oct 18, 2008 4:44 pm

Registered Newsbin User since: 12/30/07


Return to V6 Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests