469,640 Members | 1,561 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,640 developers. It's quick & easy.

DateTime Question

Hiya all, very quick question, I hope .. I have an xml dump of some old data
that I need to parse and input into a new system. A couple of date fields
are in there that have the following data (just a sample) .. ..

AvailableTimeStamp:1073866182
VerifiedTimeStamp:1073839057

AvailableTimeStamp:1074352648
VerifiedTimeStamp:1074401625

AvailableTimeStamp:1074141663
VerifiedTimeStamp:1074195299

Question is: What type of format is this, and, how do I convert it to
something I can recognize? Thanks for any suggestions
Nov 15 '05 #1
8 1383
Jimmie <ji********@hotmail.com> wrote:
Hiya all, very quick question, I hope .. I have an xml dump of some old data
that I need to parse and input into a new system. A couple of date fields
are in there that have the following data (just a sample) .. ..

AvailableTimeStamp:1073866182
VerifiedTimeStamp:1073839057

AvailableTimeStamp:1074352648
VerifiedTimeStamp:1074401625

AvailableTimeStamp:1074141663
VerifiedTimeStamp:1074195299

Question is: What type of format is this, and, how do I convert it to
something I can recognize? Thanks for any suggestions


Well, what was the old system? That format could be just about
anything. If you've got a sample of what's given *and* what it means,
we could try to deduce what conversion is going on, but with just the
above there's not a lot to go on...
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Yea, that's the problem I'm having right now .. tracking down old systems,
meanings .. etc. This was taking about a year or so ago from a business that
is now out of business, but, for some reason or another the "higher ups"
want some of the data. I didn't know if anyone would recognize or have any
suggestions on trying to figure it out.

--

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Jimmie <ji********@hotmail.com> wrote:
Hiya all, very quick question, I hope .. I have an xml dump of some old data that I need to parse and input into a new system. A couple of date fields are in there that have the following data (just a sample) .. ..

AvailableTimeStamp:1073866182
VerifiedTimeStamp:1073839057

AvailableTimeStamp:1074352648
VerifiedTimeStamp:1074401625

AvailableTimeStamp:1074141663
VerifiedTimeStamp:1074195299

Question is: What type of format is this, and, how do I convert it to
something I can recognize? Thanks for any suggestions


Well, what was the old system? That format could be just about
anything. If you've got a sample of what's given *and* what it means,
we could try to deduce what conversion is going on, but with just the
above there's not a lot to go on...
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #3
Jimmie <ji********@hotmail.com> wrote:
Yea, that's the problem I'm having right now .. tracking down old systems,
meanings .. etc. This was taking about a year or so ago from a business that
is now out of business, but, for some reason or another the "higher ups"
want some of the data. I didn't know if anyone would recognize or have any
suggestions on trying to figure it out.


Do you know *anything* about the old system, such as its name?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4
On Fri, 23 Jan 2004 14:47:22 -0500, Jimmie wrote:
Hiya all, very quick question, I hope .. I have an xml dump of some old data
that I need to parse and input into a new system. A couple of date fields
are in there that have the following data (just a sample) .. .. AvailableTimeStamp:1073866182
[SNIP] Question is: What type of format is this, and, how do I convert it to
something I can recognize? Thanks for any suggestions


This looks like a simple unix time stamp.
( Seconds since 1970/1/1 00:00:00 )

1073866182 <-> 2004/01/11 00:09:42

Till Meyer
Nov 15 '05 #5
Well, yea .. it was from a private Environmental Health agency that did
surveys and walk through of buildings and reported incidents and
infractions. That's really about all we know. Of note .. it was not zipped
... it was in tar format .. *.gz .. so, I'm assuming it's from a unix system,
but .. that's just an assumption .. not really know for sure.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Jimmie <ji********@hotmail.com> wrote:
Yea, that's the problem I'm having right now .. tracking down old systems, meanings .. etc. This was taking about a year or so ago from a business that is now out of business, but, for some reason or another the "higher ups"
want some of the data. I didn't know if anyone would recognize or have any suggestions on trying to figure it out.


Do you know *anything* about the old system, such as its name?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #6
Ahh, that's great! How would I convert this in C#? Thanks so much!

"Till Meyer" <no****@aroh.de> wrote in message
news:bu**********@user.aroh.de...
On Fri, 23 Jan 2004 14:47:22 -0500, Jimmie wrote:
Hiya all, very quick question, I hope .. I have an xml dump of some old data that I need to parse and input into a new system. A couple of date fields are in there that have the following data (just a sample) .. ..

AvailableTimeStamp:1073866182
[SNIP]

Question is: What type of format is this, and, how do I convert it to
something I can recognize? Thanks for any suggestions


This looks like a simple unix time stamp.
( Seconds since 1970/1/1 00:00:00 )

1073866182 <-> 2004/01/11 00:09:42

Till Meyer

Nov 15 '05 #7
duh .. I posted before I used my head. Simple enough to convert and this was
the correct conversion. Thanks so much! Not being from a unix background I
didn't realize the (Seconds since 1970/1/1 00:00:00 ).
Thanks for helping me figure this out so quickly!!
"Jimmie" <ji********@hotmail.com> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
Ahh, that's great! How would I convert this in C#? Thanks so much!

"Till Meyer" <no****@aroh.de> wrote in message
news:bu**********@user.aroh.de...
On Fri, 23 Jan 2004 14:47:22 -0500, Jimmie wrote:
Hiya all, very quick question, I hope .. I have an xml dump of some
old
data that I need to parse and input into a new system. A couple of date fields are in there that have the following data (just a sample) .. ..

AvailableTimeStamp:1073866182
[SNIP]

Question is: What type of format is this, and, how do I convert it to
something I can recognize? Thanks for any suggestions


This looks like a simple unix time stamp.
( Seconds since 1970/1/1 00:00:00 )

1073866182 <-> 2004/01/11 00:09:42

Till Meyer


Nov 15 '05 #8

You can use TimeSpan.FromSeconds() to get a timespan, then use
DateTime.Add( TimeSpan ) to get a new DateTime value:

public static DateTime GetDateFromTimestamp( double timestamp)
{
DateTime baseDate = new DateTime(1970,1,1,0,0,0);
return baseDate.Add( TimeSpan.FromSeconds( timestamp));
}
"Jimmie" <ji********@hotmail.com> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
Ahh, that's great! How would I convert this in C#? Thanks so much!

"Till Meyer" <no****@aroh.de> wrote in message
news:bu**********@user.aroh.de...
On Fri, 23 Jan 2004 14:47:22 -0500, Jimmie wrote:
Hiya all, very quick question, I hope .. I have an xml dump of some
old
data that I need to parse and input into a new system. A couple of date fields are in there that have the following data (just a sample) .. ..

AvailableTimeStamp:1073866182
[SNIP]

Question is: What type of format is this, and, how do I convert it to
something I can recognize? Thanks for any suggestions


This looks like a simple unix time stamp.
( Seconds since 1970/1/1 00:00:00 )

1073866182 <-> 2004/01/11 00:09:42

Till Meyer


Nov 15 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Grant Edwards | last post: by
6 posts views Thread by Carl | last post: by
3 posts views Thread by Andrew S. Giles | last post: by
8 posts views Thread by Alan Silver | last post: by
26 posts views Thread by Reny J Joseph Thuthikattu | last post: by
9 posts views Thread by Phil B | last post: by
4 posts views Thread by Philippe Martin | last post: by
5 posts views Thread by iulian.ilea | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.