Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse Complex Date

Status
Not open for further replies.

tleish

Programmer
Jan 17, 2001
619
US
I have a small C++ time card application that writes the info to a txt file. I'm trying to parse through the txt file in a web app language, but I'm not sure how to parse out the date format.

I've talked to the developer of the application, but they don't know anything about the date, they use a 3rd party dll to write to and read from the txt file. Supposedly it's supposed to be writing in an INI or Registry format, but I don't know much about that.

Any ideas?

Here are some of the strings. The dates I'm trying to parse are in bold:

7/22/01 00:00:00 (12:00:00 AM)
date=454C 8 00 00 00 00 C0 1C E2 40

7/22/01 00:30:00 (12:30:00 AM)
date=454C 8 AB AA AA AA C0 1C E2 40

7/22/01 00:30:00 (9:30:30 AM)
date=454C 8 2E D8 82 AD CC 1C E2 40

7/20/01 00:00:00 (12:00:00 AM)
date=454C 8 00 00 00 00 80 1C E2 40
- tleish
 
look in the time.h the struct tm. Just copy theese bytes from your date to struct. You'll read as tm.tm_sec... John Fill
1c.bmp


ivfmd@mail.md
 
I won't be parsing this in C++. Is there any logic to the strings above? It looks sortof encrypted to me. - tleish
 
Well... i would think the following:

Valid characters in a date are

1,2,3,4,5,6,7,8,9,0,/,:,(,),A,M,P

17 characters taken from the format above. 5 bytes would be required to encode these. I am assuming at they are using hex to represent the data you just need to determine the bytes used for each value. However, i dont know if you can do binary conversions in html alone. you may need to incorporate some java-script. Using a short 3 of these values could be encoded or with a long/int (platform dependent but sizeof(int) == sizeof(long) on my system)

They could then be masking the output value to get the 8 bits required and do an internal conversion. Figuring out the conversion is a different matter.. however, if you notice that the strings all end the same and they are all AM. Also, they all start the same 454c 8.

See what happens with pm. Then read these values into an int and see if you can do a converstion.

Matt
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top