DateTime Question

  • Thread starter Thread starter Jimmie
  • Start date Start date
J

Jimmie

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
 
Jimmie said:
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...
 
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.
 
Jimmie said:
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?
 
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
 
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.
 
Ahh, that's great! How would I convert this in C#? Thanks so much!

Till Meyer said:
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
 
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 said:
Ahh, that's great! How would I convert this in C#? Thanks so much!

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
 
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 said:
Ahh, that's great! How would I convert this in C#? Thanks so much!

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
 
Back
Top