472,952 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

borland time_t conversion

Hi all,

I have a problem converting a borland cpp (v4.52) time_t value to a visual
basic date.
What does borland exactly store? I heard this should be #seconds since
1/1/1970 0:00 in EST time. How can borland do this in dos without having set
the TZ environment variable?
I'd like to know what borland stores...

Thanks in advance,
Tomas Deman
Nov 14 '05 #1
1 3101
"Tomas Deman" <to********@PLEASEDONTSPAMhotmail.com> wrote:
I have a problem converting a borland cpp (v4.52) time_t value to a visual
basic date.
What does borland exactly store?
Who knows? Ask Borland. This is not a C matter. All the C Standard says
is that time_t is an arithmetic type used for storing calendar time; it
doesn't say anything about _how_ it does this. A long double storing a
Julian Date is legal.

FWIW, since different systems and indeed different compilers for the
same system implement time_t differently, you should never store a
time_t in a file for other programs to use. Store a well-defined date
format instead; for example, the ISO yyyymmddhhmmss format. mktime() and
strftime() are ideal for this.
I heard this should be #seconds since
1/1/1970 0:00 in EST time. How can borland do this in dos without having set
the TZ environment variable?

It can't, so it is unlikely that that is what it stores. Seconds since
0/0/1980[1] 00:00 in whatever timezone is local to the computer clock is
more likely. Now work out how many bytes it uses, what endianness it
has, and how many spacing bits there are, and you're partly on the way
to figuring out the format.
As I said: asking the C program (or, for that matter, the VB program,
the Pascal program, or whatever program wants to communicate with
someone else) to store a decent format in the first place is probably
less hassle.


[1] No kidding: set an MS-DOS file date to all-bits-zero and do a DIR.
Nov 14 '05 #2

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

Similar topics

by: HMS Surprise | last post by:
I am working with an ARM946ES processor running C under Nucleus. I need to take time and date (year, month, day, hour, minute, second) from an external RTC chip and convert it to time_t to reset...
by: smartwolf agassi via DotNetMonster.com | last post by:
I'm a C# language learner. I want to know which IDE is better for C# programing, Borland C#Builder or VS.net 2003? -- Message posted via http://www.dotnetmonster.com
by: thelaery | last post by:
Hi, I'm trying to read the belgium eid card which gives out utf8, i can convert it to ansi but now i have the problem of converting the special chart to oem. utf8 to ansi...
by: Angus Comber | last post by:
Hello I need to do this conversion but can't seem to find the function. Angus
by: Sven | last post by:
Hi, I found a strange behaviour when using the time() function from time.h. Sometimes when it is called, it does not show the correct time in seconds, but an initial value. This time seem to be...
by: MrBlueSky | last post by:
Hi, I've got a Python application that (as well as lots of other stuff!) has to translate time_t values into strings in the TZ of the users choice. Looking at the Python Library Reference, I can...
by: pbrama | last post by:
I have a customer that supplied me with a text file that has some data and dates stored, apparently, as milliseconds since 01/01/1970 12:00a. I need to display the date/time in their application. ...
by: loudking | last post by:
Hello, all I don't quite understand what does ((time_t)-1) mean when I execute "man 2 time" RETURN VALUE On success, the value of time in seconds since the Epoch is retu rned. On error,...
by: Jonathan | last post by:
I have taken up C++ programming again and need to write a socket client, so far I am able to create the connection to the socket. As I need a unix timestamp in char to put on a socket in a HTTP...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: Mushico | last post by:
How to calculate date of retirement from date of birth
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.