2011-08-01 87 views

回答

4

檢查你的情況FormatDateTime功能,你試試這個

FormatDateTime('dd/mm/yyyy',MyDate); 
+1

:)謝謝,爲什麼卻隻字未提該功能在這裏:http://docwiki.embarcadero.com/RADStudio/en/Date_and_Time_Support? – maxfax

+0

@Maxfax - 很好的問題。它在[Type conversion routines](類型轉換例程)(http://docwiki.embarcadero.com/RADStudio/en/Type_conversion_routines)中,但第二個參考將會很好 –

+4

根據您(和您的客戶)的要求,最好使用DateToStr(MyDate),因爲這將跟隨當前用戶的區域設置,例如美國用戶爲mm/dd/yyyy,英國爲dd/mm/yyyy等。美國軟件總是使用mm/dd/yy會使我感到困惑(並且困惑),所以我儘量延長我期望的相同禮節。 –

相關問題