473,507 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3133
"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.

Richard

[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

1
2872
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...
22
2197
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
3
3408
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...
7
37572
by: Angus Comber | last post by:
Hello I need to do this conversion but can't seem to find the function. Angus
18
3882
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...
2
2912
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...
3
21946
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. ...
45
9299
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,...
3
12335
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...
0
7221
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
7372
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
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
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,...
1
5039
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...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.