Difference between #11 and #12 of
Change default date format in Oracle

Revision #12 has been created by lenovo on Sep 19, 2019, 1:21:07 AM with the memo:

content formating
« previous (#11) next (#13) »

Changes

Title unchanged

change default date format in oracle

Category unchanged

How-tos

Yii version unchanged

2.0

Tags unchanged

database

Content changed

[...]
```

Add this script inside your database connection file

```
<?php
 
 
return [
 
    'class' => 'yii\db\Connection',
 
    'dsn' => 'oci:host=127.0.0.1:1521/XE',
 
    'username' => 'your_username',
 
    'password' => 'your_password',
 
    'charset' => 'utf8',
 
 
// Schema cache options (for production environment)
//'enableSchemaCache' => true,
//'schemaCacheDuration' => 60,
[...]
// $event->sender refers to the DB connection
$event->sender->createCommand("ALTER SESSION SET NLS_DATE_FORMAT='DD-MM-YYYY hh24:mi:ss'")->execute();
}
    
 
];
```
0 0
2 followers
Viewed: 3 334 times
Version: 2.0
Category: How-tos
Tags: database
Written by: lenovo
Last updated by: samdark
Created on: Sep 17, 2019
Last updated: a month ago
Update Article

Revisions

View all history