How to format RSS pubDate to DateTime?

Why is the datetime format in HTML5 different from the datetime format in MySQL?

  • When you use a datetime input type in HTML5 the string posted to the server has the format YYYY-MM-DDTHH:MM (Eg. 2011-01-09T18:30). In MySQL it is YYYY-MM-DD 18:30:26 (Eg. 2011-01-09 18:30:26). Vitally the MySQL version includes seconds and doesn't include the random T in the middle. Why? Does HTML5 not like spaces? Is it fond of imprecise times?

  • Answer:

    There is a very simple explanation to your question. 2011-01-09T18:30 is Coordinated Universal Time value. You have probably seen it referred to as UTC (Universal Time Coordinate). Greenwich Mean Time is the same as a UTC. If you want to know more you should read ISO 8601 http://uk.ask.com/wiki/ISO_8601 http://uk.ask.com/wiki/Universal_Time

Matthew Wittering at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.