473,799 Members | 3,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting current date in C in the VC environ

Hi,

I am basically a linux person being made to work on windows. and i have
been given a limited version of the windows i guess - for it doesn't
provide a proper help option :(. I sorely miss working on linux. but
now, I need to get the current date and if possible the current time as
well, from the system. I tried a lot of the inbuilt functions (like
localtime()) but it gave me errors that i couldn't rightly comprehend.
could anybody help me out with the function and its syntax, please?

Thanks a lot for your time and patience.

regards,
Scam.

Jan 13 '06 #1
7 2553
"Scamjunk" <br*********@gm ail.com> wrote:
I am basically a linux person being made to work on windows. and i have
been given a limited version of the windows i guess - for it doesn't
provide a proper help option :(. I sorely miss working on linux. but
now, I need to get the current date and if possible the current time as
well, from the system. I tried a lot of the inbuilt functions (like
localtime()) but it gave me errors that i couldn't rightly comprehend.
Are you a programmer or a luser? _Quote_ error messages, damn it! How
the blazes are we to help you solve your problem when all you're saying
is "it doesn't work"? I expect that kind of error report from my
clueless users, not from a colleague.
could anybody help me out with the function and its syntax, please?


If localtime() doesn't do the same thing under Windows as it does under
Linux, then either your Windows implementation is not a real C compiler,
or your Linux one isn't real C, or both. Or perhaps you weren't using it
correctly on Linux in the first place? We can't tell unless you post
code.

Richard
Jan 13 '06 #2
Scamjunk said:
Hi,

I am basically a linux person being made to work on windows. and i have
been given a limited version of the windows i guess - for it doesn't
provide a proper help option :(.
Service Pack 7 fixes that (and all other Windows problems), and is
downloadable for free, from: http://www.isolinux.org
I sorely miss working on linux. but
now, I need to get the current date and if possible the current time as
well, from the system.


"The C Programming Language", Kernighan and Ritchie, 2nd edition, 1988,
Prentice Hall. I draw your attention particularly to pages 255-257.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 13 '06 #3
ern
microsoft.publi c.vc.language

Jan 13 '06 #4

ern wrote:
microsoft.publi c.vc.language


struct tm;
http://alien.dowling.edu/~rohit/wiki...andard_Library

Jan 14 '06 #5
ern said:
microsoft.publi c.vc.language


Why? It's a question about standard C.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 14 '06 #6
ern

Richard Heathfield wrote:
ern said:
microsoft.publi c.vc.language


Why? It's a question about standard C.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


VC environment...

Jan 18 '06 #7
ern said:

Richard Heathfield wrote:
ern said:
> microsoft.publi c.vc.language


Why? It's a question about standard C.


VC environment...


....is irrelevant, since the question can be answered in standard C terms,
and was asked in a standard C newsgroup.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 19 '06 #8

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

Similar topics

3
3153
by: John Draper | last post by:
I am having a lot of problems trying to get a Python CGI to run. I have included 3 parts... 1) A simple stripped down python module. 2) An output of what I get when I do: python index.py (which not suprisingly should generate HTML output, and it does) 3) And the "error_log" output from the "server error" I get when I run it by typing in: http://localhost/cgi-bin/index.py
11
3945
by: jim.eggleston | last post by:
Windows doesn't have a HOME environment variable, but it does have HOMEDRIVE and HOMEPATH. Could Windows versions of Python automatically populate os.environ with HOME, where HOME = os.path.join(os.environ, os.environ)? If this was done, then modules such as pdb, which load resource files from HOME, would work under Windows. Alternatively, here is a patch to make pdb.py read .pdbrc under Windows.
9
2047
by: deko | last post by:
What is it with these dates? What are they so much trouble? All I want to do is subtract an hour, but not if that makes dtmTest less than dtmClt. Dim dtmStart As Date Dim dtmEnd As Date Dim dtmCtl As Date Dim dtmTest As Date Me!cbxEndTime.Requery Me!cbxStartTime.Requery
8
8514
by: bryan | last post by:
Is there any way I can get the application path (the one returned by Request.ApplicationPath) in the Application_Start method in Global.asax? Request is not valid there. On a related note, is there a way to get it from a static method in an aspx page, or in the class (static) constructor for an aspx page? Thanks, Bryan
4
8413
by: John | last post by:
Hi I need to get the signature folder for the current folder such as; "F:\Documents and Settings\Dave\Application Data\Microsoft\Signatures\" except that instead of Dave I need the correct name for the current user, s that my code works generically regardless of who is logged in. Is there a way to do that? Thanks
9
3751
by: boris.smirnov | last post by:
Hi there, I have a problem with setting environment variable in my script that uses qt library. For this library I have to define a path to tell the script whre to find it. I have a script called "shrink_bs_070226" that looks like this: ********************************** import sys, re, glob, shutil import os
1
3203
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as follows: The code below is for the first page:session_start is in line 3 <link href="css/jobSheet.css" rel="stylesheet" type="text/css" /> session_start();
7
2421
by: Joe P. Cool | last post by:
If I call os.environ.clear in a python program child processes still see the deleted entries. But when I iterate over the keys like so names = os.environ.keys for k in names: del os.environ then the entries are also deleted for the child processes. Where is the difference? Is this a bug? (Observed in Python 2.5.2)
3
3921
by: Tim Chase | last post by:
Not sure what's going on here and hoping for some insight: tim@rubbish:~$ echo $COLUMNS 129 tim@rubbish:~$ python2.5 Python 2.5.2 (r252:60911, May 28 2008, 08:35:32) on linux2 Type "help", "copyright", "credits" or "license" for more information. False
0
9546
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10243
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
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 we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.