question about Dates

question about Dates

Postby ukservice » Tue May 31, 2011 2:29 pm

Hello,

I have the following string: Fri, 08 Aug 2008 19:25:01 GMT

How can I get only date in dd-mm-yyyy format?.

Is possible?.

Thank you very much.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: question about Dates

Postby nageswaragunupudi » Tue May 31, 2011 3:59 pm

Code: Select all  Expand view
SET DATE ITALIAN
SET CENTURY ON
?  uCharToVal( "08 Aug 2008", "D" )

Result : 08-08-2008

If you can manage to truncate the string after the year, this function works.
Hope we can improve the function to handle full strings given by you in future versions.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: question about Dates

Postby ukservice » Tue May 31, 2011 5:04 pm

Thank you.

But the string is Fri, 08 Aug 2008.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: question about Dates

Postby nageswaragunupudi » Tue May 31, 2011 5:45 pm

Even that string also works.
Please try using the function with different combinations. Just make sure that the time stamp is not included.

eg. October 23rd 2001 works

In the next revision any strings will be handled.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: question about Dates

Postby ukservice » Wed Jun 01, 2011 11:16 am

Mr. Rao,

Thank you very much.

The help file is very small:

Syntax:




uCharToVal( <cExpression>, <uType> ) --> uValue







Parameters:




<cExpression> A string expression to be converted to a specific type.







<uType> It is value, whose type determines the kind of conversion we want to do.





But it is a very powerful function.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: question about Dates

Postby nageswaragunupudi » Wed Jun 01, 2011 11:29 am

Now in the revised build of FWH 11.05, even expressions like 'Fri, 08 Aug 2008 19:25:01 GMT' are handled.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 100 guests