Solved

Opposite of CString::Format ?

Posted on 1998-06-06
1
324 Views
Last Modified: 2013-12-03
CString oTime;
SYSTEMTIME st;
oTime.Format("%02d/%02d/%04d %02d:%02d PM",st.wDay, st.wMonth, st.wYear,st.wHour-12, st.wMinute);      

Is there any simple way to "Un"Format a CString and get back all values to a SYSTEMTIME structure? I need
this structure to do sorting. I don't think I want to manually extracts the value from the CString one by one and
make comparison between the years...then months..... it's extremely tedious.. I believe there is a simpler way to
do that, could anyone please enlighten me?
0
Comment
Question by:zhenteng
1 Comment
 
LVL 2

Accepted Solution

by:
Slarti earned 10 total points
ID: 1407072
Use sscanf:
sscanf((const char*)oTime, "%d %d etc.", &st.wDay, &st.wMonth ...);
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL to ElasticSearch Query 1 526
Visual Studio Debugging 3 109
Post a good COM tutorial 1 34
Trouble with References... 5 22
This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now