Error in date time format in Freemarker

Source: Internet
Author: User



There is a strange problem today. Colleague to visit my Computer published Program page, freemarker date format error. Other computer access is not a problem.



Post the error message first.


 
FreeMarker template error

The string doesn‘t match the expected date/time/date-time format. The string to parse was: "2015-08-27 11:50:35.013". The expected format was: "MMM d, yyyy h:mm:ss a".
The nested reason given follows:
Unparseable date: "2015-08-27 11:50:35.013"

----
FTL stack trace ("~" means nesting-related):
    - Failed at: ${model.jzUser.scdlsj?datetime}  [in template "right.htm" at line 80, column 49]
----

Java stack trace (for programmers):
----
freemarker.core._TemplateModelException: [... Exception message was already printed; see it above ...]


That is, the default date format is turned into a colleague's computer: "MMM D, yyyy h:mm:ss a"



On the official website to see some information, which refers to the default date format problem.



Http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_string_date



So I did a setting problem on the head of the page and solved it.


< #setting datetime_format= "Yyyy-mm-dd HH:mm:ss"/>


But the question is, clearly is the server-side code (freemarker), why it is related to the client's environment.



Error in date time format in Freemarker


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.