<p>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 information?</p>

<p>MSSQL has its own datetime data type, which works well in the database itself and is very readable. However, there aren't any MSSQL functions to translate datetime values to PHP's preferred format--UNIX timestamp. This makes it a bit more painful to use with PHP. UNIX timestamp is attractive because that's what PHP likes, but it's certainly not as readable and there aren't a bunch of nice built-in MSSQL functions for working with the data.</p>

<p>Would you store this information as datetime data type, as UNIX timestamps (as int, bigint, or varchar datatype), as both formats side by side, or as something else entirely?</p>

I'd recommend the same as i do for all dates in any db engine, the db native type. (DATETIME)
Just use "YYYY-MM-DD HH:MM:SS" for inserting in php:
```
date('Y-m-d H:i:s', $myTimeStampInSeconds);
```
-edit in response to comments below here -
for selected columns you can use
```
$timestamp =
strtotime
( $yourColumnValue );
```
i recommend storing in the databas native format because you can then use SQL to compare records using SQL date/time functions like DATEADD() etc.