Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 15th, 2004, 02:51 AM
Authorized User
Join Date: Aug 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default DateTime control which takes upto milliseconds


I want to a MFC date time control which can take milliseconds, seconds, minutes & hrs into consideration. I am aware of only CDateTimeCtrl in vc++, but this cannot take milliseconds. I also need to extract time from such a control and do <,>,== comparisions. Can anyone please help me?



Old September 17th, 2004, 07:57 PM
Registered User
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

This will get you time with miliseconds.

#include <stdio.h>
#include <sys/timeb.h>
#include <time.h>

void main( void )
   struct _timeb timebuffer;
   char *timeline;

   _ftime( &timebuffer );
   timeline = ctime( & ( timebuffer.time ) );

   printf( "The time is %.19s.%hu %s", timeline, timebuffer.millitm, &timeline[20] );

Similar Threads
Thread Thread Starter Forum Replies Last Post
not able to print child nodes upto 2 level eruditionist XSLT 3 October 30th, 2008 01:10 PM
regular expression for number upto 2 decimal place swati_joshi ASP.NET 1.0 and 1.1 Basics 3 July 31st, 2008 11:23 AM
DateTime Control for WebForms avats ASP.NET 1.0 and 1.1 Professional 2 July 13th, 2007 10:25 PM
Milliseconds MathLearner Beginning VB 6 0 May 15th, 2007 07:44 AM
Converting datetime to milliseconds since.. ravishakya SQL Server 2000 1 September 11th, 2006 07:47 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.