Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [arrayItem] => DateTime Object
- (
- [date] => 2008-06-05 09:14:11
- [timezone_type] => 3
- [timezone] => Europe/London
- )
- $connectionParams = array(
- 'USR'=>'user',
- 'PASS'=>'pass',
- 'Database'='myDatabase',
- 'ReturnDatesAsStrings'=>true //<-- This is the important line
- );
- $conn = sqlsrv_connect('127.0.0.1',$connectionParams);
- $myDateTimeObject->getTimestamp();
- $array['arrayItem']->date;
- $array['arrayItem']->timezone_type;
- echo $array['arrayItem']->format('Y-m-d H:i:s');
- $_date = DateTime::createFromFormat('D M d Y H:i:s e+', $the_date);
- foreach($_dateStart as $row){
- echo $row; // returns 2014-06-04 15:00
- break; // stops at the first position
- }
- $array['arrayItem']->format('Y-m-d H:i:s');
- $serverName = "your_sqlserver";
- $username = "your_username";
- $password = "your_password";
- $database = "your_database";
- $connectionInfo = array( "UID"=>$username, "PWD"=>$password, "Database"=>$database, "ReturnDatesAsStrings"=>true);
- $connection = sqlsrv_connect($serverName, $connectionInfo);
- $result = sqlsrv_query( $connection,"SELECT * from table'");
- $msrow = sqlsrv_fetch_array($result);
- $obj->arrayItem->format('H:i:s')
- $obj->arrayItem->format('Y-m-d')
- date('Y-m-d', strtotime($rs->Fields('time')->value)
Add Comment
Please, Sign In to add comment