473,480 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

c++ functions to enumerate days for a month?


Hi,
I am creating a simple calander application,
user can enter a date,and i will create a calender for the month which
contain the date
which is the function that get the month part of a date?
which is the function to get the days for a month?

Thanks in advance

May 21 '06 #1
4 3613
TOMERDR wrote:
which is the function that get the month part of a date?
which is the function to get the days for a month?


Open your time.h file, and research time(), mktime(), and localtime().

--
Phlip
May 21 '06 #2
"TOMERDR" writes:
I am creating a simple calander application,
user can enter a date,and i will create a calender for the month which
contain the date
which is the function that get the month part of a date?
which is the function to get the days for a month?


If I were in your place I would write my own functions for both of those.

Doing so is instructive and fun and should give you a feel for what
programming is like.

In the US the conventional form for a date is mm dd yyyy. So the month part
is the first field the user types.
May 21 '06 #3

"TOMERDR" <to*****@hotmail.com> wrote in message
news:11**********************@38g2000cwa.googlegro ups.com...

Hi,
I am creating a simple calander application,
user can enter a date,and i will create a calender for the month which
contain the date
which is the function that get the month part of a date?
which is the function to get the days for a month?

Thanks in advance


It all depends on how you allow the users to enter the date. There are
various possible formats. For example (in the US), "09/27/06",
"09/27/2006", "Sept. 27, 2006", "September 27, 2006", and "27 Sep 2006" are
all ways to specify the 27th of September of this year. I believe there are
some functions in time.h which might help (but I don't know them
personally). Various functions might also be provided by your operating
system or compiler. Or you could write your own "parser" to break the
string into its parts, either according to rules you specify or according to
some kind of format string such as that which printf uses. It's really up
to you. If you need more help, you'll need to be more specific.

-Howard

May 22 '06 #4
TOMERDR wrote:
Hi,
I am creating a simple calander application,
user can enter a date,and i will create a calender for the month which
contain the date
which is the function that get the month part of a date?
which is the function to get the days for a month?


Support for dates and times in standard C++ is quite small, you may be
better served by Boost.Date_Time (www.boost.org). You can also check in
the <ctime> standard header (http://tinyurl.com/6u87b).
Jonathan

May 22 '06 #5

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

Similar topics

14
6395
by: Paul Moore | last post by:
I was just writing some code which did date/time manipulations, and I found that the Python 2.3 datetime module does not supply a number of fairly basic functions. I understand the reasoning (the...
2
3402
by: David Mitchell | last post by:
I have tried using the following code to count the specific number of each weekday but get a compile error "User defined type not defined" which I think relates to the first line of the function: -...
4
7687
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
60034
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...
5
7496
by: coleenholley | last post by:
I've been an Access Programmer for several years, and found that the EndOfMonth function is very valuable when trying to do closing dates and the like.. Is there a function in VB.Net that does the...
19
4492
by: Ricardo Perez Lopez | last post by:
Hello everyone: I'm a PostgreSQL newbie, working now with dates, times, timestamps and intervals. I have three questions about the above: FIRST: --------
0
16473
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
16
4428
by: W. eWatson | last post by:
Are there some date and time comparison functions that would compare, say, Is 10/05/05 later than 09/22/02? (or 02/09/22 format, yy/mm/dd) Is 02/11/07 the same as 02/11/07? Is 14:05:18 after...
0
974
by: Hendrik van Rooyen | last post by:
John Machin <sj..con.netwrote: This will work nicely for negative values of D. The case of positive D values is more of a toffee: Its Wednesday and I make some observations. Its Thursday...
0
6908
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
7048
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
7088
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
6956
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
5342
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,...
0
2997
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2986
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
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
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.