Hi,
Is there a function available to convert date into the Following Format
"07-Jan-2010"
Date() -> "07-Jan-2010"
Regards
Anser
Hi,
Is there a function available to convert date into the Following Format
"07-Jan-2010"
Date() -> "07-Jan-2010"
Regards
Anser
use fwh function:
cValToStr( dDate, 'dd-mmm-yyyy' )
This function works independent of the date format setting.
you can use dd, mm, mmm, mmmm in any order
for example 'mmmm dd, yyyy' produces October 23, 2009
This is the function XBrowse uses internally. We can oCol:cEditPicture in this format for date values.
Hi Anserkk,
Try this:
function main ()
local a,b,c
a := Str(Day(Date()))
b := CMonth(Date())
c := Str(Year(Date()))
MSGINFO(a+ "-" +b+ "-" +c)
return nil
The result is: "7-January-2010"
Regards.
Dear Mr.Rao,
Thank you. cValToStr( dDate, 'dd-mmm-yyyy' ) served my purpose.
Hope I can use the same function to convert 24 Hrs. time format to 12 Hrs AM/PM format.
Where can I get more information on the formats supported by cValToStr(). In Five Wiki I did not find the write up for cValToStr(), but information on cValToChar is available.
Dear Mr.DiegoCandel,
Thank you for your support
. I was checking whether a built in function is available or not.
Regards
Anser
Hi all,
To convert 24 hrs time format to 12 Hrs AM/PM format we can use the Function AmPm(cTime)
Regards
Anser
This function is not yet documented on fivewiki, but you can search the whatsnew.txt.
no. it does not support hours and minutes still
Thank you Mr.Rao,
AMPM(cTime) served my purpose.
Regards
Anser
local tDate
SET DATE ITALIAN
SET TIME FORMAT TO 'HH:MM:SS PM'
tDate := DateTime()
MsgInfo( TtoC( tDate ) )
MsgInfo( TtoC( tDate, 2 ) )
MsgInfo( cValToStr( tDate, 'DD-MMM-YYYY' ) + ' ' + TToC( tDate, 2 ) )I feel dealing with date and time values separately have become things of past. Now datetime variables can be used directly.
SELECT Branch_Short_Name, Last_Upload, CONVERT(varchar(10), Last_Upload, 108) as UploadTime FROM BranchescValToStr( tDate, 'DD-MMM-YYYY' ) + ' ' + TToC( tDate, 2 )I read the column values directly into a single datetime variable and use for further computations. Straight Sql.
Can always display date part or time part separately or together.