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

Declare a Date Type in VC++

Hi,
I am new to VC++. Net.I have a doubt to declare a date type in VC++.Net.

I have a char type lc_date as 20060815.

I want to subtract 15 days from this date.

I tried the following code.

char lc_date = '20060815'.

int lc_intdate = atoi( lc_date) - 15;

My output should be '20060731'.

I know that it will not work.

Please help me how to declare a date type and to get the exact out put that I need.

Its very urgent.

Any suggestion would be highly greatful.Thanks in advance.

Regards,
Priya. B
Nov 13 '06 #1
2 1461
mdaRock
26
use the functions come with the date datatype insted of subtracting.

like this

Expand|Select|Wrap|Line Numbers
  1.  
  2. date d,f;
  3.  
  4. f = d.subtract (timespane);
  5.  
  6.  
Hi,
I am new to VC++. Net.I have a doubt to declare a date type in VC++.Net.

I have a char type lc_date as 20060815.

I want to subtract 15 days from this date.

I tried the following code.

char lc_date = '20060815'.

int lc_intdate = atoi( lc_date) - 15;

My output should be '20060731'.

I know that it will not work.

Please help me how to declare a date type and to get the exact out put that I need.

Its very urgent.

Any suggestion would be highly greatful.Thanks in advance.

Regards,
Priya. B
Nov 13 '06 #2
Hi,

Since it is SDK and not MFC, syntax error occurs.
Please give me another solution to calculate it.
Nov 15 '06 #3

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

Similar topics

21
by: Javier | last post by:
Hi I´ve a routine that will read date and times in a vector of strings ie: 30/02/2005 19:20 In some moment I´ll need to check if there are in vector a date like current date with a time...
10
by: Simon | last post by:
I'm a js newbie trying to use some very simple js to call an ActiveX object's methods. I need to use a pointer to call an embedded ActiveX object's method to receive a number. As I understand it,...
5
by: Paolo | last post by:
We are experiencing a problem with COleDateTime while migrating our MFC&ATL project from VC++6.0 to VC++7.1 (Visual Studio .NET 2003). COleDateTime has a DATE conversion operator that in 7.1 asserts...
15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
1
by: VC | last post by:
I have a textbox where users type in a date. I want to check that the input is between year 2000 and the current date. Here is segment of the codes that give me the "Server tags cannot contain...
4
by: Thomas | last post by:
I tried the following: Public Class ClassA Public Class ClassB Private myName As String Private myBirthday As Date Public Property Birthday() As Date Get Return myBirthday
1
by: vbJustin | last post by:
Hello again, I have a question here. Can anyone tell me where I can access a simple, up to date web service for SOAP for the Weather. I have been programming a form on VB 6.0 to intake a zipcode,...
9
by: =?Utf-8?B?UmFqZXNoYXowOQ==?= | last post by:
I heared that microsoft give technical support to vb upto this year end. Can any one microsoft stops techinical support for vc++(6.0)? was microsoft announced any official date?
3
by: Ed | last post by:
Hi, guys, I add some new projects. No source file, but only some copy operation in Post Event. The project is to do some file deployment for some third party library. When I compile the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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:
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:
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
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
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...

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.