Is the toString() method in java.util.Date locale independent? -


    try {          simpledateformat strtemp = new simpledateformat("ddmmmyy", locale.us);           date reasult = strtemp.parse(input);          string   checkdate = reasult.tostring().substring(8, 10) + reasult.tostring().substring(4, 7) + reasult.tostring().substring(26);          if (!checkdate.touppercase().equals(input))              return false;           else           return true;        } catch (exception ex) {             return false;      } 

as api tells me java.util.date.tostring() format "dow mon dd hh:mm:ss zzz yyyy", want know if content format of tostring() change while windows locale changed? such "russian","english", suggest input same, checkdate value same? help.

date.tostring() locale independent. significant change can ever observe timezone, depends on timezone settings of computer. by design.

converts date object string of form:

   dow mon dd hh:mm:ss zzz yyyy 

where:

  • dow day of week (sun, mon, tue, wed, thu, fri, sat).
  • mon month (jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec).
  • dd day of month (01 through 31), 2 decimal digits.
  • hh hour of day (00 through 23), 2 decimal digits.
  • mm minute within hour (00 through 59), 2 decimal digits.
  • ss second within minute (00 through 61, 2 decimal digits.
  • zzz time zone (and may reflect daylight saving time). standard time zone abbreviations include recognized method parse. if time zone information not available, zzz empty - is, consists of no characters @ all.
  • yyyy year, 4 decimal digits.

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -