Home Forums Programming General How do I assign the correct date ? RE: How do I assign the correct date ?

  • Actually, the SQL standards support TWO date formats, not one. 'YYYYMMDD hh:mm:ss' and 'YYYY-MM-DDThh:mm:ss'. (I'm not showing all the decimal places for the seconds.)

    Nope. While the ISO 8601 standard has several different display formats, the ANSI/ISO standard SQL allows only one; "yyyy-mm-dd <space>hh:mm:ss" Notice the space and not the T separator. We did not we did not want options. I would actually like to see the T separator for the practical reason. This would let you write a timestamp as a single string of characters, without the spaces. But that is not how we voted.

    Books in Celko Series for Morgan-Kaufmann Publishing
    Analytics and OLAP in SQL
    Data and Databases: Concepts in Practice
    Data, Measurements and Standards in SQL
    SQL for Smarties
    SQL Programming Style
    SQL Puzzles and Answers
    Thinking in Sets
    Trees and Hierarchies in SQL