CTime issue

Hello all,

for my application, I need to store birthdays into a database. So I 
decided to use CTime a CDateTimeCtrl. It worked well until I entered the 
a date from 1956. After reading the documentation, it seems that CTime 
can't handle dates /before/ 1970-01-01.

How can I handle this? Or should I do it manually (an int for day, 
another one for the month and the last one for the year)?

Thanks in advance.
0
7/17/2008 2:02:28 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
610 Views

Similar Articles

[PageSpeed] 6

On Wed, 16 Jul 2008 21:02:28 -0500, Fernando G�mez
<fernando.a.gomez.f@gmail.com> wrote:

>Hello all,
>
>for my application, I need to store birthdays into a database. So I 
>decided to use CTime a CDateTimeCtrl. It worked well until I entered the 
>a date from 1956. After reading the documentation, it seems that CTime 
>can't handle dates /before/ 1970-01-01.
>
>How can I handle this? Or should I do it manually (an int for day, 
>another one for the month and the last one for the year)?
>
>Thanks in advance.

You don't have to use CTime. You could use COleDateTime or even the SDK's
FILETIME for this.

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
7/17/2008 2:15:34 AM
That's right; CTime is not good for anything before the "epoch date".  If you use a
FILETIME, you can represent birthdays back to 1-Jan-1600.
				joe

On Wed, 16 Jul 2008 21:02:28 -0500, Fernando G�mez <fernando.a.gomez.f@gmail.com> wrote:

>Hello all,
>
>for my application, I need to store birthdays into a database. So I 
>decided to use CTime a CDateTimeCtrl. It worked well until I entered the 
>a date from 1956. After reading the documentation, it seems that CTime 
>can't handle dates /before/ 1970-01-01.
>
>How can I handle this? Or should I do it manually (an int for day, 
>another one for the month and the last one for the year)?
>
>Thanks in advance.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
7/17/2008 4:45:28 AM
Doug Harrison [MVP] wrote:
> On Wed, 16 Jul 2008 21:02:28 -0500, Fernando G�mez
> <fernando.a.gomez.f@gmail.com> wrote:
> 
>> Hello all,
>>
>> for my application, I need to store birthdays into a database. So I 
>> decided to use CTime a CDateTimeCtrl. It worked well until I entered the 
>> a date from 1956. After reading the documentation, it seems that CTime 
>> can't handle dates /before/ 1970-01-01.
>>
>> How can I handle this? Or should I do it manually (an int for day, 
>> another one for the month and the last one for the year)?
>>
>> Thanks in advance.
> 
> You don't have to use CTime. You could use COleDateTime or even the SDK's
> FILETIME for this.
> 

Thanks, I think I'll go with COleDateTime.

Regards.
0
7/17/2008 2:21:29 PM
Reply:

Similar Artilces:

Location Issues
> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3341044023_631757 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: 8bit One of the ways I backup Entourage is to copy the current identity to an external archive drive. I have just discovered that I may be copying the wrong identity. I went to the Entourage 2008 Identities folder, and there I found 3 identities�the one that existed at the time of importing it from 2004, a rebuilt identity, and a backu...

New internet issue with desktop and laptop
As of two nights ago, I cannot be on the internet on my desktop (with a cable modem) and on the internet on my laptop (wireless router) at the same time. I do not know of any recent changes. Chris "Chris" <Chris@discussions.microsoft.com> wrote in message news:CA7C1A7B-59E7-48D1-AE93-4F63B7A25353@microsoft.com... > As of two nights ago, I cannot be on the internet on my desktop (with a > cable > modem) and on the internet on my laptop (wireless router) at the same > time. > I do not know of any recent changes. > > Chris Is your P...

MSN Passport issue
I had my assistant create a money 2007 file for my business accounts. She did so and entered in the information i needed, but now when i try and open the file it only works under her passport info. Because she works with me, it's not a problem to logon w/her info. I was able to add my name as a shared user under the tools/sharing menu. But I'm unable to see how to change the owner's name and logon info. Help. Thankyou in advance MN Crap!.... not more than 5 minutes after hitting send I found what i was looking for under the file/password manager. I must have looked aro...

PST Backup Install Issue
After instaling pst backup from the pfbackup.exe program, the "Backup" option does not appear in the "file" menu in Outlook 2002 (version 10 SP3). How do I run pst backup? Thanks, jkj Problem solved with the advice of David from another post. Here is what he said: The add-in may not be registered correctly. So, try registering the dll with the following steps. 1. Exit Outlook. 2. On the Start menu click Run 3. In the Open box type the following and click OK. regsvr32 "c:\program files\microsoft office\office\addins\outbak.dll" NOTE: You may need...

Possible Replication issues
Hi All, I am using an Exchange 5.5 environment, with NT4 based servers. I have three servers in one site in addition to several worldwide. One acting as a bridgehead and the other two with an equal share of mailboxes on them. I have noticed that whenever I delete mailboxes off one of the servers in the site, the entry does not get deleted from the Address List on the other server. If a user whose mailbox resides on that one server checks the Global Address List from within Outlook, it still appears, even though on the other server and all worldwide servers, it have been removed. It just se...

Outlook Issue #7
I am using Outlook2003SP1 with Exchange 2003. When I first start outlook and open either a message or a calendar request when I press the button(s) or select from the menu any of these functions; send, reply, forward, reply to all, accept, decline, print, permissions, follow up, previous, next basically any function nothing happens. The only things that seems to work is the close, change font and move to folder buttons/functions. Once I close the item and open it up again everything works. I have to do this for either messages or calendar items. I have tried creating a different mail prof...

CDialog issues
There is a class derived from CDialog, CMainDialog::CDialog Now with in this class there is a function, void CMainDialog::StartNewDialog() { CMainDialog m_MainDlg; m_MainDlg.DoModal(); } Here nother instance of CMainDialog is opened. So once this is executed, right now there are 2 CMainDialog dialogs open. There are 2 issues thats coming up in this scenario. 1. When the 2nd CMainDialog is opened, it gets opened right on top of 1st CMainDialog. I think this is because of default window positioning. How to make sure that 2nd CMainDialog opens a bit away from the 1st dialog, so that U...

Login Issue
I have just downloaded Money 2006 and I have been unable to login the first time. I cannot get support until I can supply a product ID number which I cannot get until I log on. Any suggestions? -- Cindy Return it and buy Quicken. .... If you contact support via phone they will give you a product ID. I found this out after spending 1 hour on the phone with them last night. No, I am still unable to login myself. I will be making a purchase of Quicken tonight as I can no longer waste any more time on MS Money. I use Quickbooks at work and prefer the functions anyway. Even if MS Mon...

Sidebar issue
I recently had to do a complete system reset back to factory defaults. I've spent two days downloading and installing all the various updates and getting things back the way I liked them. I do like using some of the gadgets in Windows Sidebar, but unfortunately they are displayed much bigger icon size than the other icons on my desktop. Changing the desktop area or dpi or resolution changes the size/etc of all the other icons on the desktop, but doesn't affect the sidebar gadget sizes at all. Any suggestions? On Fri, 23 Jul 2010 10:22:35 -0400, Jan Rodman wrote: ...

E-mail Issues
I have a couple of questions regarding our e-mail server. We are running Windows 2003 SBS, and use the exchange server included for incoming and outgoing e-mail. Incoming appears to operate without any issues, however, the outgoing e-mail is extremely slow for e-mail being sent off of the server. E-mail from one address to another within our domain (ie. on our own server) is instant. My questions are: 1) What would cause such slow outgoing mail that has a destination elsewhere? We recently had to re-install Windows Server, and it seems that this is a new issue. E-mail does get t...

Business Portal Issue
Hello Members, I am facing problems regarding Business Portal 3.0 client connectivity with server machine. I have Windows 2003 Server, SQL Server 2000 with SP4, Great Plains 9.0 & Share Point Services 2003. I install Business Portal 3.0 on server machine there was no problem regarding installation & Business Portal 3.0 is running fine on the server machine & after installation I add domain user, assign roles & give all required permission according to the help file of the Business Portal 3.0. But unfortunately when I tried to connect client PC having Windows XP Professio...

IE 8 and eBay issue
For the past week or so I've encountered an annoying problem when signing in to eBay. I type the email address and password which ordinarily gets me into eBay, however now it takes me to a screen that says I've signed out. There's an option to sign in again, and this time I can get in. I've contacted the eBay live help 3 times and have followed their instructions; i.e., 1) clear temp. files, cookies, etc. 2)use Firefox because it's "probably an IE problem" ??? 3) reboot computer (duh--as if I hadn't done that a number of times over the past we...

very very interesting email routing issue
Hi all exchange experts Here is a real challange for you guys. We have 5 sites, all with exchange 2000 and windows 2000 with all the patches and service packs (although I don't think they have any part to play in this issue). Now here, for some reason, all these 5 sites are compeletely independent of each other, each site with just one server which is windows 2000, so obviously one and only domain controller, one and only exchange server. The common to them is the address space. I will start with example so it is easy to undersand. I am just cosidering email domain here, nothing to do...

Archiving issue
Error while archiving folder "Inbox" in store "Personal Folders". Errors have been detected in the file C:...\Microsoft\Outlook\archive.pst. Quit Outlook and all mail-enabled applications, and then use the Inbox repair tool (Scanpst.exe) to diagnose and repair errors in the file. Following this procedure does not fix problem. Archiving was working before, but now, does not work. Any solutions to this? -- Joe Nojokes Did scanpst.exe find any errors? What is the size of your pst-file? If around 1.8GB, then start with a new pst-file or convert it to Unicode if...

Exchange database restore issues
Hi All! Last morning we have had hardware failure on our Exchange Server 2003. After that some mailbox and public folder databases became corrupted. We tried restore it from last backup, but had no luck - got error: "An internal processing error has occured. Try restarting exchange server manager and Microsoft exchange information store or both. ID C1041724" ESEUTIL /mh say that state is Dirty Shutdown (how it could be happen in backup?) Now we are trying to repair databases using ESEUTIL /p. On public folder store (5G) it took about 30 min and finished successfully. But...

Sales Returns Issue
Hi It is allowing us to pass a Sales return into GP from customer A into customer B account without any warning from GP. In other words, GP allows us to pass a return for a customer who doesnt have a sales invoice processed. This is being raised as an issue by the internal audit team. Why GP doesnt even give warning when we try to pass a return for which no quantity to be returned / invoice exists. Thanks Janakiram M.P. You can enter a return without an invoice. The return is put on account and applied to the invoice later. You could do a return with a miscellaneous item to give the cu...

RegisterWindowMessage, HWND_BROADCAST between exe and dll issue
i have the following problem, that i've been looking at and googling about for past 4 days to no avail. i have an exe, let's call it exe1, that is ours, that runs as some user, "Administrator" in this particular case, on a given machine, that does following: UINT uiStringA = RegisterWindowMessage("StringA") and then has ON_REGISTERED_MESSAGE(uiStringA, stringAHandler); then i have a vendor's exe, that runs as a service under "System" user and that loads 1 standard c dll, which in turn loads 2nd dll, let's call it dll2, which is also ours and m...

Exchange Backup to disk backup/restore issues?
Does anyone know of any issues with regards to utilising NAS based Backup-To-Disk folders for a single server based Exchange 2003 backups and restores ? We are planning to move our current tape auto-loader to another part of our company, and are planning on backing up our server based Exchange Server to a NAS device currently on the network. Thanx Susie I have done this in a disaster recovery situation. I needed a quick backup of the store, so I ran a disk-to-disk backup to a nas device and then rebuilt the server and restore the database from there, it worked great for me. My dail...

Adobe issues
We are running GP 9.0, using Windows 7, just installed Adobe 8.0 and are unable to send documents to PDF from GP - the PDF option remains grayed out. We have folowed the KB articles that are available, no success. Do we need to install Adobe 9.0 due to running Windows 7? Is GP 9.0 compatible with Adobe 9? Thank you for any assistance.. Hi Susan, I have a client using Adobe 9 on Windows 7. However, they are on GP 10.0 It is working succesfully. -- Geoff James "Susan" wrote: > We are running GP 9.0, using Windows 7, just installed Adobe 8.0 and are ...

IE8 downloading issue
Just installed it and now I can not download anything. When I go to open a file such as a pdf it says 0% and never does anything. Help! Always state your full Windows version (e.g., WinXP SP3; WinXP 64-bit SP2; Vista SP1; Vista 64-bit SP2; Win7; Win7 64-bit) when posting in a forum or newsgroup. Please do so in your next reply. What anti-virus application or security suite is installed and is your subscription current? What anti-spyware applications (other than Defender)? What third-party firewall (if any)? Were any of these applications running in the background when you ...

OOF issue
When I use the out of office assistant I set it exactly how you are supposed to. I can do so through rules, rules and alerts, or just the out of office message itself. I email myself and it runs fine. However, when I email myself from an external account (hotmail is what I used), there is no autreply sent. Anyone ever deal with this? Thanks ahead of time! Matt, Is this at home or at work? If it's at work then I would guess that they're running Exchange. I believe there is a setting on Exchange that has to be enabled/disabled to allow the Out Of Office reply to work. Speak to ...

VSS issue on SBS 2008
I am using Backup Exex 12.5 on SBS 2008. For 6+ months my backups have been running fine, but last week they began failing with the following: Backup- SBS2008 - AOFO: Initialization failure on: "\\SBS2008\Microsoft Information Store\First Storage Group". Advanced Open File Option used: Microsoft Volume Shadow Copy Service (VSS). V-79-10000-11226 - VSS Snapshot error. The Microsoft Volume Shadow Copy Service (VSS) snapshot provider selected returned: "Unexpected provider error". Ensure that all provider services are enabled and can be started. Check the Window...

Account Overview report issue?
Hi, I am trying to run the Account Overview report (open an Account, run the report from there). It chugs over it for a second or two, then I get the following 2 errors: Error: subreport could not be shown. Note: The maximum number of accounts in this report cannot exceed 10. The account I am running this on does not have any subaccounts and has a total of 4 contacts. Has anyone seen similar errors with this report? Thanks for any help... Jon DearJon What language are you running in? Is your environment SQL 2005? Go to the Reports section and look at the "Hidden" repor...

Need expert coding help with a debugging issue.
I've got a piece of code in a form on my front end db that updates a record in a table based on certain criteria. My problem is that this code seems to have a flaw in it that allows multiple instances of this code, running on different machines, to access the exact same record in the table, if the following conditions are met: 1. The code is executed at the exact same time 2. The record being updated in the target table has no current value The table has three fields: Bin Number, Vendor Name, and Count. My problem is that when Vendor Name is empty when the code is run by two users a...

Can not login due to error 0x80090019
Hi! I got a severe virus infection on an old pc at home, which ofc contains some cherished family photos and other docs which are important to me.. Now, I've got rid of the virus, I hope, but during testing and finding solutions to my problem, I had to put the C: drive in another computer for back-up, as I feared the master disk was about to collapse.. anyway, I can now access the old system in Safe-mode, but when I try any other configuration Windows reject login, stating error 0x80090019 - Windows is unable to validate your copy.. or something.. Is it a simple solution t...