 |
|
 |
Hi...
How to find 3rd friday date in every month in every year...help me
|
|
|
|
 |
|
 |
Hi.. really its good tool.. its very useful for me.. thanks buddy..
Sankaradoss Srirengan, Verizon Data Services Inc., Tampa, FL 33637.
|
|
|
|
 |
|
 |
Thanks for the demo
|
|
|
|
 |
|
 |
Hi guys,
I have a string, for example '1085462900'. I have to convert this string into a CTime / COleDateTime value. How can i do this?
I get this string from a oracle database.
P.
|
|
|
|
 |
|
 |
If you know the format the string is in, I believe you can use the Parse function of those classes.
Regards,
Alvaro
Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is. -- GWB, 1999.
|
|
|
|
 |
|
 |
#include
#include
#include
#include
#include
void main()
{
char tmpbuf[128];
time_t stime;
struct tm * today ;
time( &stime );
today = localtime( &stime );
//today = localtime( 1119856245 ); I thought this
printf( "stime = %d \n", stime);
printf( "today = %d \n", today);
/* Use strftime to build a customized time string. */
strftime( tmpbuf, 128, "Today is %A, day %d of %B in the year %Y %.\n", today );
}
Just a start, wel it also doesnt work.
|
|
|
|
 |
|
 |
Nothing to find on internet for this, who can help?
|
|
|
|
 |
|
 |
P-Rex wrote: I have a string, for example '1085462900'.
If this is supposed to be a date/time value, what format is it in? Without knowing at least that much, it's going to be hard to assign it to a CTime/COleDateTime object.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
 |
|
 |
Thanks, helped my debugging a lot.
|
|
|
|
 |
|
 |
I have a web form in which i take user'sdate of birth.now i take the day, month n year seperately. i then concatenate it into a single string. now my problem is that how can i convert it nto date type?? like is there any function in C# like cdate in VB.net???
Waiting 4 reply....
|
|
|
|
 |
|
 |
Look at System.DateTime.Parse.
Regards,
Alvaro
"I do" is both the shortest and the longest sentence in the English language.
|
|
|
|
 |
|
 |
i have created a COM component in VB which has DATE data type in one of interface function. when i call the function from VC.. its booming..
0.0000000000 value is returned..
can anybody explain me the problem.. and what can be probable solution to this..
anirban
|
|
|
|
 |
|
 |
Does anybody know of a function that can correctly convert a CString to a Date or a time value.
I'm busy with a T&A and Payroll System and the people that wrote the access control wrote everything in to their database as text.
So PLEASE can anybody help.
|
|
|
|
 |
|
 |
Try "COleDateTime::ParseDateTime" from MFC or you got to parse the string to get the substrings of the values (hh:mm:ss dd/mm/yyyy) and retrieve the numbers via "atol" function and then create a CTime. It is depending on your format.
I hope it helps
|
|
|
|
 |
|
 |
Thanx problem sorted some time ago using ParseDateTime.
I have a problem with Datetime calculations though. I writing a costing application and I need to know how many hours where worked in a month. Problem is COleDateTime only calculates up to 24 hours and I need more. COleDateTimeSpan on the the other hand returns ex. 1 day and 16:45 hours which means I have to process that result back to a number and then get a result.
Do you know of an easier way?
|
|
|
|
 |
|
 |
CString x ="1/1/2001 10:12:12";
int m, d, Y, H, M, S;
sscanf("%d/%d/%d %d:%d:%d", m, d, Y, H, M, S);
CTime t(Y, m, d, H, M, S);
|
|
|
|
 |
|
 |
CString x ="1/1/2001 10:12:12";
int m, d, Y, H, M, S;
sscanf(x, "%d/%d/%d %d:%d:%d", &m, &d, &Y, &H, &M, &S);
CTime t(Y, m, d, H, M, S);
|
|
|
|
 |
|
 |
Just if anyone knows...
How to convert formatted string into CTime\COleDateTime for the cases like this:
CString str = "Monday, 01-Jan-2001";
???
Statement:
COleDateTime tm;
tm.ParseDateTime(str);
doesn't work for me
|
|
|
|
 |
|
 |
Nice work. I used to deal with this problem by writing small conversion functions and then running them in the watch window. The one advantage to doing it that way is the string representation automatically updates while stepping through the app.
     -keithb
|
|
|
|
 |
|
 |
Good !
But I am lazy...
... can you post here your code, so we don't have to replicate the work you did ?
Thank you,
Marcello
|
|
|
|
 |
|
 |
An even better method is to create an auto expression that calls COleDateTime::Format. Then you don't need to do anything else.
|
|
|
|
 |
|
 |
It should be noted when using COleDateTimeSpan that this class does not account for daylight savings time.
Where DST is used it may be necessary to convert COleDateTime values to CTime values before calculating time spans.
>>>-----> MikeO
|
|
|
|
 |