473,406 Members | 2,707 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,406 software developers and data experts.

HEX Date creation

Jim
Can someone tell me how the following date and time is created to the
Hex value (also shown below)?

Tuesday, July 08, 2003 10:56:38 AM

hex:00,90,a6,7b,66,45,c3,01

I need to be able to create the hex value for any date, but am not
sure how to break it down. Serail Parts?
Jul 17 '05 #1
1 10619
ja************@teldta.com (Jim) wrote in message news:<e5**************************@posting.google. com>...
Can someone tell me how the following date and time is created to the
Hex value (also shown below)?

Tuesday, July 08, 2003 10:56:38 AM

hex:00,90,a6,7b,66,45,c3,01

I need to be able to create the hex value for any date, but am not
sure how to break it down. Serail Parts?

Timestamps can be expressed as seconds or milliseconds since a
given epoch. If you check out java.util.Date you'll see it can
'convert' dates to and from this type of format, using a 'long'.

There are eight hex numbers above, each representing a byte.
The first thing to try is to see if these bytes represent a
long, by forming the digits into a String (minus the commas)
and converting said string to a Date object by parsing the
value using base 16.

String hexString="0090a67b6645c301"; // Woundn't be hardcoded!
Date d = new Date(Long.parseLong(hexString,16));

Obviously this will only work if the value represented by the
hex string is scaled the same as Java expects (ie: measures
milliseconds, not seconds) and uses the same epoch. If not,
you'll have to tinker with the long value to get it in the same
scale, and/or adjust the epoch. (Java uses Jan 1st 1970 00:00:00
GMT --- other languages/API's use 1900 not 1970!)
-FISH- ><>
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: [ EuGeNe ] | last post by:
Hi all, I would like to write a script that downloads one file from a ftp server if the file creation date satisfy a condition. I can't figure out how to find from a ftp server what is the...
2
by: Fabrizio | last post by:
I have just put a internet webcam that save every 30 seconds a picture via ftp. I have an html file that display this picture file (the name of the file is always the same and the webcam delete the...
3
by: Dave | last post by:
I recently did a search of my very first web site, through WebArchive, located here: http://web.archive.org/collections/web.html However, I'm seeking the creation date of my web site (and...
2
by: David Fickbohm | last post by:
People, I am trying to determine the creation date of files in a folder. I am using the following code to find the folder and confirm that files exist in the folder. If someone could give me an...
4
by: wil | last post by:
Dear All, In the linux platform, is there anyway I can in a C program change the file create date? Thanks, wil.
3
by: Steven Blair | last post by:
Hi, I have a trace log file for a system I am writing. If the creation date is older than 14 days, I have to rename that file (File.Move). The next time a trace message is required a new file is...
2
by: Raed Sawalha | last post by:
I wondering if it possilble to get the directory files ordered by creation date string files = System.IO.Directory.GetFiles(strPath,"*.msg") can I sort the returned file by creation date? ...
6
by: KoRnDragon | last post by:
I know about getlastmod() but is there one for created date? If not is there some other way of getting the created date of a file?
3
by: tkpmep | last post by:
I'd like to create a list of all files in a directory that were created after a certain date. How does one do this? I've used glob.glob to create a list of all files whose name matches a substring,...
1
by: sylendrap | last post by:
Hi Guyz, I am new to Access Databases. My question looks to be very simple. I have created a textbox.I want to display the creation date of the file in that box. What needs to be done. ? I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.