473,395 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1505
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Grant Edwards | last post by:
Is it true that a datetime object can convert itself into a string, but not the other way around? IOW, there's no simple way to take the output from str(d) and turn it back into d? So, I tried...
6
by: Carl | last post by:
Hi, to be use with SQL server database 1- From window form textbox object From this assignement, txtTOTAL.Text="0.00m"; How do you convert back to decimal type ? How do you assign a...
3
by: Andrew S. Giles | last post by:
Hello, I am importing a flat text file, and putting it into a datagrid for display on a form. Currently the users have their dates and times seperated. I have two fields, therefore in the...
8
by: Alan Silver | last post by:
Hello, I have a custom control that displays the date and time. I currently have properties for the day, month, year, hour and minute, which have to be set separately. This is inefficient. I...
26
by: Reny J Joseph Thuthikattu | last post by:
Hi, I have a variabe in the format of 'DD-MON-YYYY HH:MI AM' .I want to add a miniute to it.How can i do that? by manipulation i want to make '01-JUNE-2004 11:59 PM' to '02-JUNE-2004 12:00 AM'...
9
by: Phil B | last post by:
I am having a problem with a datetime from a web services provider The provider is sending the following SOAP response <?xml version="1.0" encoding="utf-8"?> <soap:Envelope...
4
by: Philippe Martin | last post by:
Hi, I need to get the date and time under Windows and Linux but need the information visible to the user (cannot find my words) not the sytem information (ex: a PC setup on greenwich but the...
5
by: iulian.ilea | last post by:
Is correct to have a varchar field and insert dates of type dd/mm/yyyy into it? I choose this method because I have an application that runs on more than one server. So, if I used a datetime field...
0
by: maolimix | last post by:
Hi to all, I have a trouble with datetime...now I explain.. I must to store to a C# variable the values from a "Datetime column" of Sql Server 2005. I tried 3 methods ...in the first two I never...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.