Time stamps in Trac plugins

11 views
Skip to first unread message

Steffen Hoffmann

unread,
Mar 25, 2013, 5:47:44 AM3/25/13
to trac...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I'm asking for your opinions here.

Do you feel, that new time fields should in general use the new POSIX
microseconds format, or is it ok to use seconds, if the extra precision
doesn't matter, i.e. no change tracking like done for ticket changes? If
I understood correctly, this was the main reason behind the move to
microseconds for Trac time field.

Current Trac schema is not completely convincing, because it has a mix
of both:
microseconds (since 0.12):
'time' in 'attachment'
'time' in 'wiki'
'time' in 'revision'
'time' in 'ticket'
'changetime' in 'ticket'
'time' in 'ticket_change'
'due' in 'milestone'
'completed' in 'milestone'
'time' in 'version'

seconds:
'time' in 'auth_cookie'
'last_visit' in 'session'

In Trac plugins it is much less common. Until now I've found
microseconds time fields in 0.12/trunk branches of
AnnouncerPlugin
WatchlistPlugin
RemoteTicketPlugin
TracJsGanttPlugin
MailPlugin
BudgetingPlugin
MsSqlBackendPlugin

but only WatchlistPlugin using it in the 0.11 branch too.

Reason behind is that I plan to add time stamps to VotePlugin [1] for
generating lists like 'vote history' etc. [2]. As use cases include
reports with SQL JOIN on ticket or wiki table, this might be an argument
to go for microseconds.

Indirectly this is a question about persistence of support for seconds
time fields in trac.util.datefmt, specifically about 'to_timestamp'.
That's why I'm not asking at trac-users.

Hoping to get some helpful comments here.

Sincerely,

Steffen Hoffmann


[1] http://trac-hacks.org/wiki/VotePlugin
[2] http://trac-hacks.org/ticket/7592
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlFQHTsACgkQ31DJeiZFuHe9aQCfRMxL+J1ZBK/dWax6EyxxuNsu
HYMAmQGinI2az8OmrSTxQQ3N/C8NFYZP
=Zl0j
-----END PGP SIGNATURE-----

Christopher Nelson

unread,
Mar 25, 2013, 8:19:26 AM3/25/13
to trac...@googlegroups.com
> I'm asking for your opinions here.
>
> Do you feel, that new time fields should in general use the new POSIX
> microseconds format, or is it ok to use seconds, if the extra precision
> doesn't matter, i.e. no change tracking like done for ticket changes? If
> I understood correctly, this was the main reason behind the move to
> microseconds for Trac time field.
> ...

There's no harm in having a bunch of 0s at the end of your time stamp
if all you need is second resolution but there is lot to be gained
from consistent format. I'd vote for all microseconds.

RjOllos

unread,
Mar 26, 2013, 9:24:53 PM3/26/13
to trac...@googlegroups.com

What Chris says makes sense to me, so I'd also suggest going with microseconds unless the Trac devs suggest differently.

Steffen Hoffmann

unread,
Mar 27, 2013, 3:55:11 AM3/27/13
to trac...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks, already going that direction.

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlFSpdsACgkQ31DJeiZFuHd5twCfXYybKLR9eJvO69XXzcK2Q60J
NOoAoISdL6d+uBuXXdSU+L/kWKQDnHFh
=n1Al
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages