MySQL time field format and encoding conversion, a temporary solution for saving time data in XML under C #

Source: Internet
Author: User

Because the XML string generated by calling the dataset built-in method getxml () in C # does not have the XMLSCHEMA Architecture
In the generated XML string, the time format is"2009-07-07t14: 58: 27 + 08: 00 "stored

If there is no comment on the XMLSCHEMA architecture during receiving end parsing
<Xs: Element Name="Dept_createtime"Type="Xs: datetime"Minoccurs="0"/>
XML data"2009-07-07t14: 58: 27 + 08: 00 "will be parsed by Default Characters

So in the project, my solution is to generate a specific string format when querying using SQL statements.

Convert (date_format (N. node_begin_time, '% Y. % C. % e') using utf8) as begin_time
// Use the date_format () function to format the style.
// Use the convert () function for encoding and conversion to generate the C # string encoding method. Otherwise, it will be displayed in the database and displayed in C # as a system. byte []

ReferenceArticle:
MySQL uses the date_format () function to convert the string to the time type and format the time.

Related Article

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.