c - What is the correct way to get a LOCALE_SSHORTDATE that is guaranteed to have a full (4-digit) year number? -


i want create date-time picker control shows both date , time, combination of dts_shortdatecenturyformat , dts_timeformat styles. since there no such style built date-time picker, have myself getlocaleinfoex().

i notice default, getlocaleinfoex(locale_sshortdate) seems return four-digit year, want. reliable? it's not documented anywhere, there can more 1 string locale_sshortdate. if have enumerate possible strings, how know 1 one want? first string contain yyyy? doesn't sound reliable me, @ least not on own...

thanks.

no can't rely on locale_sshortdate having four-digit year, since user able configure through region control panel , options two-digit years available.

if want enforce 4 digit year (and override user's preference) may provide own short date string. alternatively, scan user's string , change "yy" "yyyy".


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -