how to get the end of month date and time in Visual C++ 6.0

I am using visual c++ 6.0 and MFC. How can I convert the end of month
date and time (New York time) to local time?

For example,  if a user run my application in Japan on Feb. 3th, 2008,
I need to convert New York time 23:59:59 Feb. 29th, 2008 to Japan
time. The result may be 13:59:59 March 1st, 2008 Japan time.

Code snippet will be appreciated.

Thanks
Ningjun

0
2/1/2007 4:08:06 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
372 Views

Similar Articles

[PageSpeed] 51

On 1 Feb 2007 08:08:06 -0800, ningjun.wang@lexisnexis.com wrote:

>I am using visual c++ 6.0 and MFC. How can I convert the end of month
>date and time (New York time) to local time?
>
>For example,  if a user run my application in Japan on Feb. 3th, 2008,
>I need to convert New York time 23:59:59 Feb. 29th, 2008 to Japan
>time. The result may be 13:59:59 March 1st, 2008 Japan time.
>
>Code snippet will be appreciated.
>
>Thanks
>Ningjun

You need to use the Win32 SDK function TzSpecificLocalTimeToSystemTime
to convert the Japanese local time to UTC and then use
SystemTimeToTzSpecificLocalTime to convert from UTC to NY local time. 

Bear in mind that the format function requires XP or later.

Here's a link to a Codeproject article to get you up and running:

http://www.codeproject.com/useritems/TimeZoneConverter.asp

Regards,
PJ Naughter

Naughter Software
Mail: pjna at naughter.com
Web: www.naughter.com
Hotmail/MSN Messenger: pjnaughter at hotmail.com

It is finally on the shelves... the book from Joseph Gama and I:

http://www.amazon.com/Super-SQL-Server-Systems-Performance/dp/0976157322
0
pjna (22)
2/2/2007 10:02:23 PM
Reply:

Similar Artilces:

Filtered Lookups
Hi, I wanted to filter values in one lookup (Lkup2 ) based on the selection made in another lookup (Lkup1) Is there a way I can achieve this without 1 - going for any paid products or 2 - modifying the CRMWeb\_controls\lookup\lookupsingle.aspx page Thank you very much Check this out, it has it http://www.microsoft.com/downloads/details.aspx?familyid=634508DC-1762-40D6-B745-B3BDE05D7012&displaylang=en Have a look here: http://www.eggheadcafe.com/software/aspnet/35418198/how-to-restrick-a-lookup.aspx this thread was about filtering the lookup of "primary contact" to contacts ...

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

compact database at run time
hi How can i compact my access database programmatically .. In MSDN they gave a code like #import "C:\PROGRAM FILES\COMMON FILES\System\ado\Msado15.DLL" #import "C:\PROGRAM FILES\COMMON FILES\System\ado\MSJRO.DLL" no_namespace try { IJetEnginePtr jet(__uuidof(JetEngine)); jet->CompactDatabase( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\nwind2.mdb", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\abbc.mdb;" \ "Jet OLEDB:Engine Type=4"); } catch(_com_error &e) { ::MessageBox(NULL, (LPCTSTR)e.De...

Target.Offset(0, 36).Value Help
In the below, I use this to force the persons USERNAME to populate 36 rows to the right in a column I hide. This shows me who was in a spreadsheet and updating ONE specific column... Column AD. My question is this... Can I poulate a named range with their USERNAME. I want to insert a named range, then force the USERNAME there. (INSERT>NAME>DEFINE>) Private Sub Worksheet_Change(ByVal Target As Excel.Range) Const myRange As String = "ad7:AD90" 'Const myrange As String = "A3,A6,A8,A11,A16" On Error GoTo stoppit Application.EnableEvents = False...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

need a date look here
This is a multi-part message in MIME format --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Get all the hots girls @ www.pearlymae.com --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/html Content-Transfer-Encoding: quoted-printable <html> <head> <meta name=3D"GENERATOR" content=3D"Microsoft FrontPage 6.0"> <meta name=3D"ProgId" content=3D"FrontPage.Editor.Document"> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindow...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

I can not open doc file attachments from outlook express 6.0
I can not open doc file attachments in outlook express 6.0 Error message - There is not enough memory to open file All other attachments eg: jpeg etc are fine I have already increased my paging memory. >-----Original Message----- >I can not open doc file attachments in outlook express 6.0 >Error message - There is not enough memory to open file >All other attachments eg: jpeg etc are fine=20 >I have already increased my paging memory. >. > These Newsgroups address Office Outlook issues. Outlook Express gurus hang out here: http://communities.microsoft.com/newsgroups/def...

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

EPays w/ Processing Date
I've been using MM for a number of years and have had relatively few problems...until now with MM05. I've searched this NG and FAQ web site but haven't found the issue/resolution. I have always had MM to record EPays with the PROCESSING DATE and have it checked in Settings/Online Services. MM05, however, records the transaction in the register with the SUBMITTING DATE. For example, yesterday I sent 2 payments to be paid on the 13th of the month but MM recorded yesterday's date NOT the payment date. That transaction, once submitted can't be changed as the check numbe...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

Customizing marketing list view in 3.0
I have created a marketing list in CRM 3.0 (member type: contact) but the marketing list member view only gives me the name, business phone, and city. I need to add fields including the company name or this list is completely useless. The customization options I found only allows changes to the view that contains the list of marketing lists, not the member list. How do I add fields to this view? I have a similar problem and tried to change views on contacts and accounts - associated view and it did not change the mkt members view - looking for help as well. "jjohnson" w...

Spreadsheet getting corrupted
Hello All: I have a relatively large spreadsheet. I am getting errors (see after my signature line). What could be causing these errors? Is it that the spreadsheet is too large? Thanks Deguza -------------------------------------------------------- Microsoft Office Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\deguza\My Documents\sales\Sales_2006_2007.xls' The following is a list of repairs: Global PivotTable report information was repaired due to integrity problems. Global PivotTable report information was repaired due to integrity problems. Glo...

Reg getting the next IV Document Number field !
Hi, I am creating a window in dexterity similar to the item transaction entry window (Transactions>Inventory> Transaction Entry). In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field. I wanted to know if there is any function , or table that i can access to get the next document number in the new window that i am creating. Thanks, swetha -- swetha >In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field.< T...

How do I get??
Sorry if this seems a fairly easy question to you guys. I have a spreadsheet and I need to get the current system time into a cell. The format of the time is hh:mm am/pm. Any assistance would be most helpful. Hi try =INT(NOW()) in this cell and format is to your needs -- Regards Frank Kabel Frankfurt, Germany PM wrote: > Sorry if this seems a fairly easy question to you guys. > > I have a spreadsheet and I need to get the current system time into a > cell. The format of the time is hh:mm am/pm. > > Any assistance would be most helpful. PM, in the cell you want pu...

Get notified when Out of Office is on
I am using Outlook 2007. With 2003, when returning from leave, I used to get a notification that the Outlook out of office was still on and asking me if I wanted to switch it off. This reminder no longer appears with 2007. How can I switch this setting on so that I get the notification? "Mary Ann" <MaryAnn@discussions.microsoft.com> wrote in message news:ED5533A7-D0EA-41B8-B1A0-A9D15FB6FD98@microsoft.com... >I am using Outlook 2007. With 2003, when returning from leave, I used to get > a notification that the Outlook out of office was still on and asking me ...

If it returns #N/A, making it return 0
I have a list of numbers, that at the end of their row it averages them. However, the numbers are obtained by a VLOOKUP function. If it can't find what it's looking for, it returns #N/A which makes it so it can't calculate the average at the end. Is there any way to get the VLOOKUP function to return 0 instead of #N/A? Or maybe make the cell return 0 if the VLOOKUP function returns #N/A? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ Also, if it return...

Getting Control ID in Active X control
GetWindowLong return 0. You need to call GetDlgCtrlID from outside the activex control as the function available within the control returns an arbitrary value of zero. Take a look at this article http://xendra.ens.uabc.mx/~sinfante/loo/libro/ch17_4.htm particularly the paragraph preceeding the title "MFC and Ambient Properties". This really begs the question why you want the ID in the first place as activex controls have to be fully self containing to operate - with a few exceptions where sibling controls need to be able to locate each other. - Tim "ytv" <...

over VPN, it gets stuck when sending outgoing email
When I use VPN to connect to work from home, the outlook can not finish sending outgoing emails. The progress bar moves to the end but then stops there forever. It can never finish. The receiving of new incoming emails work fine. All other network functionality works, e.g. internet browsing, telnet, ftp, etc, all work fine. My system is win2k. I use linksys wireless DSL router. I'd appreciate any hint! Are you using Exchange server? I'd set up your mail profile to prompt you to work offline or online - when using VPN, work offline with scheduled syncs. If not using exchange, pos...

Months or Years remaining, formatting
Hello all. =(A1-(NOW()))/365 The above formula gives me years remaining as "X.XX YEARS" (currently I have the cell formatted as 0.0" years"; ) This is a two-part question: (a) FORMULA CHANGE: I want to change the formula so that the result is the same, UNLESS [LESS THAN 1 YEAR], THEN "X.XX MONTHS" (b) FORMATTING METHOD: should i set up a conditional formatting solution, or can I just do this all in one in-cell formula? Any help would be much apprecieted. - Jim -- James C ------------------------------------------------------------------------ James C...

Great Plains 8.0 and FRx 6.7
I am running a test install of Great Plains 8.0 and FRx 6.7 from Great Plains 7.6 and FRx 6.5. We also have Forecaster 6.7 installed. The install for Great Plains 8.0 and the service packs went fine execpt when I try to recreated the test company I get an error on creating a view for cash management. The real problem that I am having is after the install of FRx 6.7 I get an error when trying to open a company. The error message is "OFSI server FSGreatPlains60 is not available. Make sure it is installed and registered properly". What is the OFSI Server and where do I find ...

Display a person's age in years & months: for example 4;11
How do you show a person's chronological age in years & months in Excel: I want the age to show up as 4;11 (4 yr 11 mo), not as 4.91. Thanks! long winded but it works for me. =ROUNDDOWN(((TODAY()-A1)/365.25),0 &";"&ROUNDDOWN(MOD((TODAY()-A1),365.25)/365.25*12,0) A1 contains the persons birth date -- dcronj ----------------------------------------------------------------------- dcronje's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=528 View this thread: http://www.excelforum.com/showthread.php?threadid=26285 Hi, Try =DATEDIF(A1,...