From: Charles Tam on
I've a function that format time to string (see below). How do I write a
function that converts the formatted string back to time? Could you please
include your example with syntax?

CString convertTimeToString(const long input_time){
CString str_time;
str_time.Format("%.3d:%.2d:%.2d.%.3d",
input_time/3600000,
(input_time%3600000)/60000,
(input_time%60000)/1000,
input_time%1000);
return str_time;}
From: Atul on
One way is to use COleDateTime::ParseDateTime, then use
COleDateTime::GetAsSystemTime and create a CTime object from the SYSTEMTIME.

-Atul, Sky Software http://www.ssware.com
Shell MegaPack ActiveX & .Net
Drop In Windows Explorer like Shell Browsing GUI controls for your app.


"Charles Tam" <CharlesTam(a)discussions.microsoft.com> wrote in message
news:F18C5F91-D876-4960-A206-F79613933683(a)microsoft.com...
> I've a function that format time to string (see below). How do I write a
> function that converts the formatted string back to time? Could you
> please
> include your example with syntax?
>
> CString convertTimeToString(const long input_time){
> CString str_time;
> str_time.Format("%.3d:%.2d:%.2d.%.3d",
> input_time/3600000,
> (input_time%3600000)/60000,
> (input_time%60000)/1000,
> input_time%1000);
> return str_time;}


From: Charles Tam on
Would you be able to show me how I should use COleDateTime?

"Atul" wrote:

> One way is to use COleDateTime::ParseDateTime, then use
> COleDateTime::GetAsSystemTime and create a CTime object from the SYSTEMTIME.
>
> -Atul, Sky Software http://www.ssware.com
> Shell MegaPack ActiveX & .Net
> Drop In Windows Explorer like Shell Browsing GUI controls for your app.
>
>
> "Charles Tam" <CharlesTam(a)discussions.microsoft.com> wrote in message
> news:F18C5F91-D876-4960-A206-F79613933683(a)microsoft.com...
> > I've a function that format time to string (see below). How do I write a
> > function that converts the formatted string back to time? Could you
> > please
> > include your example with syntax?
> >
> > CString convertTimeToString(const long input_time){
> > CString str_time;
> > str_time.Format("%.3d:%.2d:%.2d.%.3d",
> > input_time/3600000,
> > (input_time%3600000)/60000,
> > (input_time%60000)/1000,
> > input_time%1000);
> > return str_time;}
>
>
>