[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Re: Convert Date of Exported Log

From: Steven Kohus <steven.kohus_at_tcs.com>
Date: Fri, 21 Aug 2009 13:27:51 -0700 (PDT)

> Management by statistics is a bad way to go, but if that's what your
> managers require, so be it.

It is more for quality assurance than management. Things such as bugs per thousand lines of code, files outdated that should be updated routinely (it is a web application), average time to fix a bug, etc.

> How are you reading this in the first place?

For testing I am just manually exporting the logs from Tortoise (through Settings -> Cached Repositories -> Export) and reading them in as text files, but the goal is to have them automatically exported via command line.

> It's the number of seconds since the Epoch - 1/1/1970 00:00:00Z. The
> .NET Framework's Time & Date methods have lots of ways to work with
> this.

I tried this already, but it throws an error due to the number being too large and out of range for adding seconds:

double d = double.Parse("1247253286220549");
DateTime b = new DateTime(1970, 1, 1);
b = b.AddSeconds(d); // Throws error.

I did some math and 1247253286220549 is approximately 39550142 years? Assuming my math is right: 1247253286220549 / 60 / 60 / 24 / 365. So I did't think it is the seconds from the Epoch.

39 years looked right though, so I divided it by 1000000. And converted it a local time and it worked ^^. So I guess it is nano-seconds from the Epoch? Thank you very much for your assitance.

Here is the final C# code:

double d = double.Parse("1247253286220549");
DateTime b = new DateTime(1970, 1, 1);
b = b.AddSeconds(d / 1000000).ToLocalTime();

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2386117

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-08-21 22:37:50 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.