rla
Posts: 18
|
Posted: 08/22/2011, 10:48 PM |
|
I am struggling trying to get a value which is a date and use it in a CCDLookup. The database is MYSQL, so it wants the format in yyyymmddnnss - date in the field itself is formated like
8/23/11, 01:20:09 AM
I have tried a few conversions ideas, but nothings working out. Anyone have tips on how to convert a getvalue or gettext to correct format?
FROM string 8/23/11, 01:20:09 AM
TO 20110823012009
Thanks
|
|
|
jacem
Posts: 87
|
Posted: 08/23/2011, 7:13 PM |
|
Hope these code snippets help you:
//displaying formated dates in label fields from cclookups
//the first array is stating how the date is coming in from the db and won’t change, the second array is the date format you want the date displayed in this time.
$Container->fieldtodisplaydate->SetValue(CCFormatDate(CCParseDate(
CCDLookUp("Createddae", "tablename", "ID='somecondition'",
$Page- >Connections["DatabaseConnectDB"]),array("yyyy","-","mm","-","dd",
" ","hh",":","nn",":","ss")),array("dd","-","mm","-","yyyy")));
|
|
|
rla
Posts: 18
|
Posted: 08/24/2011, 9:01 PM |
|
Thanks got me on the right track to get it done
CCFormatDate(CCParseDate($ActualFiles->UploadDate->gettext(),array("GeneralDate")), array("yyyy","mm","dd","HH","nn","ss"))
|
|
|
mamboBROWN
Posts: 1713
|
Posted: 09/05/2011, 10:02 AM |
|
rla,
If your answer has been solved please put [RESOLVED] or [SOLVED] in the thread header. Thanks...
|
|
|
|