Difference between #4 and #5 of
Change default date format in Oracle

Revision #5 has been created by lenovo on Sep 17, 2019, 10:29:48 AM with the memo:

code formatting
« previous (#4) next (#6) »

Changes

Title unchanged

change default date format in oracle

Category unchanged

How-tos

Yii version unchanged

2.0

Tags unchanged

database

Content changed

[...]
Too solve this issue, we must change date format oracle like date commonly using
```
ALTER SESSION SET NLS_DATE_FORMAT=...
```

For complete script
 
``` 
 
return [
 
    'class' => 'yii\db\Connection',
 
    'dsn' => 'oci:host=127.0.0.1:1521/XE',
 
    'username' => 'YOUR_USERNAME',
 
    'password' => 'YOUR_PASSWORD',
 
    'charset' => 'utf8',
 
Add this script inside your database connection file
 
``` 
 
......

// Schema cache options (for production environment)
//'enableSchemaCache' => true,
[...]
$event->sender->createCommand("ALTER SESSION SET NLS_DATE_FORMAT='DD-MM-YYYY hh24:mi:ss'")->execute();
}
];... ```
0 0
2 followers
Viewed: 34 487 times
Version: 2.0
Category: How-tos
Tags: database
Written by: lenovo
Last updated by: samdark
Created on: Sep 17, 2019
Last updated: 4 years ago
Update Article

Revisions

View all history