473,406 Members | 2,220 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.

time and date functions in C?

15
Can anyone say how to get and set the time and date of our choice , i mean in our own format like dd/mm/yy and 24 hrs clock using the existing functions or user-defined functions??????
thanks in advance
Jul 22 '10 #1
1 1437
donbock
2,426 Expert 2GB
The relevant Standard Library functions are declared in time.h. The C Standard Library does not include any functions for setting the time. You will need to use a platform-specific function for that.

Standard functions localtime and time can be used together obtain the current tm time. Standard function strftime can be used to convert a tm time into a string of whatever format you desire.

The sticky post at the front of the forum has links to Standard Library references. You would have had your answer an hour ago if you had looked there first.
Jul 22 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: sylvian stone | last post by:
Hi, I've used standard date functions in the past, but need to create something a little different, as I am working on an investment calculator. What I need to do is validate two dates, and...
1
by: shaun | last post by:
I need to calculate a duration in seconds between 1 January 1970 and an arbitrary date (e.g today) within an xslt transform which gives the same answer as the time.h functions would in C. I can use...
3
by: Roel Castro | last post by:
Hello everyone, Could somebody help me how to open time/date item in Control panel by codes in access form modules? Taking in consideration the operating system which is Windows 98, Windows 2000...
4
by: Russell | last post by:
I have an assignment that I have to complete. I have to write a windows app in C#. Here is the spec: 1/ Date Comparison Build a program that will find the number of days between two dates. You...
5
by: Kiran | last post by:
Hi, Please help on date functions in C#. I would like to know the relevant exampl to retrieve 2 weeks before date from the current date, 1 month before date from the current date and number...
3
by: IntraRELY | last post by:
I have the following function, Notice how I am passing the dateInterval as a string. What is the correct way to pass "DateInterval.Year" as a variable to a function? TIA, Steve Wofford...
9
by: Bob Achgill | last post by:
I would like to use the timestamp on files to manage the currency of support files for my VB windows application. In this case I would only put the timestamp of the file in the management database...
1
by: madhu | last post by:
I want db2 date functions and what is the diffrence between the oracle date functions and db2 date functions?
5
by: tombarth11 | last post by:
I have an Access 2003 SP2 Application in which I split the data base into 2 files: data-only.mdb and interface.mdb. I then "compiled" the interface file to a .mde file. Both files are on a server....
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: 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
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:
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
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
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.