I am planning a PHP application that needs to store date/times in an MSSQL database. (For the curious, it is a calendar application.) What is the preferred format to store this
Hello and good day for everyone
Yes , might be thats the best way , store dates in db, they will take db format and you can format when you need as you wich
But there is another one solution in the ISO-developed international date format, i mean ISO 8601.
The international format defined by ISO (ISO 8601) tries to address all date problems by defining a numerical date system as follows: YYYY-MM-DD where
YYYY is the year [all the digits, i.e. 2100] MM is the month [01 (January) to 12 (December)] DD is the day [01 to 31] depending on moths :P
Using numerical dates does have also some pitfalls with regard to readability and usability it is not perfect.But ISO date format is, however, the best choice for a date representation that is universally (and accurately) understandable.
Note that this format can also be used to represent precise date and time, with timezone information
Here is a detailed information about ISO 8601:2000
http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/date_and_time_format.htm
With no more.... Bye bye