2011-08-1
instead of
2011-08-01
Is there a cool way in LiveCode to zero fill format the 1 to an 01
WITHOUT using the assembler type notation of format()?
Code: Select all
-- any thing cooler than:
if the Length of item 1 of pAUSdate is 1 then
put "0" & item 1 of pAusDate into Item 1 of pAUSDate
end if
Code: Select all
Function ConvertAUSDateToSQLDate pAUSDate
-- dd/mm/yyyy to yyyy-mm-dd
set the itemdelimiter to slash
put item 3 of pAUSDate & "-" & item 2 of pAUSDate & "-" & item 1 of pAUSDate into theDate
return theDate
end ConvertAUSDateToSQLDate
Function ConvertUSDateToSQLDate pUSDate
-- mm/dd/yyyy to yyyy-mm-dd
set the itemdelimiter to slash
put item 3 of pUSDate & "-" & item 1 of pUSDate & "-" & item 2 of pUSDate into theDate
Return theDate
end ConvertUSDateToSQLDate