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

system date and time update

I am looking for functions that can be used to automatically update the
system date and time on an NT based system, resulting from manually entered
date and time values input by an operator via a 32-bit console app. Any
ideas?..I may have to look further afield at Win32 API's, etc but I wondered
if there was any way to do it via C initially.

Merry Xmas to all !!!
Nov 14 '05 #1
4 7155
"The Spoon" <co***************@baesystems.com> wrote in
news:3f********@baen1673807.greenlnk.net:
I am looking for functions that can be used to automatically update the
system date and time on an NT based system, resulting from manually
entered date and time values input by an operator via a 32-bit console
app. Any ideas?..I may have to look further afield at Win32 API's, etc
but I wondered if there was any way to do it via C initially.


No, not with ISO C. You'll want a win32 newsgroup where they can tell you
how to do it in Windows NT. ISO C does not deal with system specific
details like this (or serial ports, or graphic cards, or parallel ports,
etc.)

--
- Mark ->
--
Nov 14 '05 #2
The Spoon <co***************@baesystems.com> spoke thus:
I am looking for functions that can be used to automatically update the
system date and time on an NT based system, resulting from manually entered
date and time values input by an operator via a 32-bit console app. Any
ideas?..I may have to look further afield at Win32 API's, etc but I wondered
if there was any way to do it via C initially.


(The below welcome text was originally written by Ben Pfaff)

Your question is outside the domain of comp.lang.c, which discusses
only the standard C programming language, including the standard C
library. This is a remarkably narrow topic compared to what many
people expect.

For your convenience, the list below contains topics that are not
on-topic for comp.lang.c, and suggests newsgroups for you to explore
if you have questions about these topics. Please do observe proper
netiquette before posting to any of these newsgroups. In particular,
you should read the group's charter and FAQ, if any (FAQs are
available from www.faqs.org and other sources). If those fail to
answer your question then you should browse through at least two weeks
of recent articles to make sure that your question has not already
been answered.

* OS-specific questions, such as how to clear the screen,
access the network, list the files in a directory, or read
"piped" output from a subprocess. These questions should be
directed to OS-specific newsgroups, such as
comp.os.ms-windows.programmer.misc, comp.unix.programmer, or
comp.os.linux.development.apps.

* Compiler-specific questions, such as installation issues and
locations of header files. Ask about these in
compiler-specific newsgroups, such as gnu.gcc.help or
comp.os.ms-windows.programmer.misc. Questions about writing
compilers are appropriate in comp.compilers.

* Processor-specific questions, such as questions about
assembly and machine code. x86 questions are appropriate in
comp.lang.asm.x86, embedded system processor questions may
be appropriate in comp.arch.embedded.

* ABI-specific questions, such as how to interface assembly
code to C. These questions are both processor- and
OS-specific and should typically be asked in OS-specific
newsgroups.

* Algorithms, except questions about C implementations of
algorithms. "How do I implement algorithm X in C?" is not a
question about a C implementation of an algorithm, it is a
request for source code. Newsgroups comp.programming and
comp.theory may be appropriate.

* Making C interoperate with other languages. C has no
facilities for such interoperation. These questions should
be directed to system- or compiler-specific newsgroups. C++
has features for interoperating with C, so consider
comp.lang.c++ for such questions.

* The C standard, as opposed to standard C. Questions about
the C standard are best asked in comp.std.c.

* C++. Please do not post or cross-post questions about C++
to comp.lang.c. Ask C++ questions in C++ newsgroups, such
as comp.lang.c++ or comp.lang.c++.moderated.

* Test posts. Please test in a newsgroup meant for testing,
such as alt.test.

news.groups.questions is a good place to ask about the appropriate
newsgroup for a given topic.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #3
"The Spoon" <co***************@baesystems.com> wrote:
# I am looking for functions that can be used to automatically update the
# system date and time on an NT based system, resulting from manually entered
# date and time values input by an operator via a 32-bit console app. Any
# ideas?..I may have to look further afield at Win32 API's, etc but I wondered
# if there was any way to do it via C initially.

If NT accepts a command-line to do this the way Unix accepts a date command,
it might be easiest to sprintf the command to a string and then call
system() to run the command.

On unix I would do something like
char command[1000];
sprintf(command,"date %04d%02d%02d%02d%02d.%02d",
year,month,day,hour,minute,second);
if (system(command)!=0) {error-processing;}

--
Derk Gwen http://derkgwen.250free.com/html/index.html
Quit killing people. That's high profile.
Nov 14 '05 #4

"The Spoon" <co***************@baesystems.com> wrote in message
news:3f********@baen1673807.greenlnk.net...
I am looking for functions that can be used to automatically update the
system date and time on an NT based system, resulting from manually entered date and time values input by an operator via a 32-bit console app. Any
ideas?..I may have to look further afield at Win32 API's, etc but I wondered if there was any way to do it via C initially.

Merry Xmas to all !!!


This XP machine here, and any MSWindows machine I have used, has DATE to
check/set the date and TIME to check/set the time.Why do you want to write a
C program to do the same job?
Nov 14 '05 #5

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

Similar topics

16
by: jason | last post by:
I'm tearing out my hair here: ACCESS 2000: When I attempt to overwrite a date in my date field with a new user selected valid date eg: 05/23/99 my date field changes to the TIME I updated the...
7
by: Nicolae Fieraru | last post by:
Hi All, I have a table tblProducts where I have four fields:\ Index, ProductName, EnterDate (as Date/Time - Medium Date), PurchaseDate (Date/Time - Medium Date) The EnterDate is automatically...
5
by: m_t_hill | last post by:
Running MS Access 2000 MS Windows XP Pro This has caused me a lot of hair loss in the last few days so would appreciate any help. I am running code to append/update a local access database...
3
by: Travis | last post by:
I am trying to display a query like this in my windows form: SELECT workordernumber, date, firstname, lastname FROM customer_db; I am using a rich text box to display the data but it only...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
2
by: Colli | last post by:
Hi: I need to setup a continuously updating system Date/Time in my user interface. I can get the system date/time and can cause it to update with a button-click but I can't seem to figure out how...
1
by: Patrick | last post by:
Has been trying to get an ASP.NET DLL's modification date/time for the "release date/time" to be displayed on the page's footer Using: System.Reflection.Assembly...
1
by: thehuby | last post by:
I am prototyping a ticket booking system and just wanted to ask a few questions. 1 - What is the standard way of temporarily reserving a number of tickets throughout the purchasing process (to...
0
by: DC | last post by:
Why would this code give me the error "Could not load type System.Web.UI.WebControls.AccessDataSource from assembly System.Web, Version=1.0.5000.0" at line 16... <form id="form1"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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
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,...

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.