powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / MySQL [игнор отключен] [закрыт для гостей] / Time zone
2 сообщений из 2, страница 1 из 1
Time zone
    #38735652
JulT
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Всем привет.
Объясните пожалуйста такую вещь. Мое приложение формирует и пытается записать в базу дату в виде:
Код: java
1.
date = 2014-09-03T10:33:46.926+07:00

(Новосибирское время)
Когда пишу в локальную базу даты записываются в нужной мне тайм зоне, но когда пишу на удаленный сервер, который находится где-то в Питере, в базе дата представлена в таком виде:
Код: java
1.
2014-09-03 03:33:46

.
Если я правильно поняла, мне нужно где-то в настройках mysql прописать Новосибирскую зону, как это сделать? Спасибо :)
...
Рейтинг: 0 / 0
Time zone
    #38735893
tanglir
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
JulTЕсли я правильно поняла, мне нужно где-то в настройках mysql прописать Новосибирскую зону, как это сделать?
http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html Per-connection time zones. Each client that connects has its own time zone setting, given by the session time_zone variable. Initially, the session variable takes its value from the global time_zone variable, but the client can change its own time zone with this statement:
mysql> SET time_zone = timezone;


The current session time zone setting affects display and storage of time values that are zone-sensitive. This includes the values displayed by functions such as NOW() or CURTIME(), and values stored in and retrieved from TIMESTAMP columns. Values for TIMESTAMP columns are converted from the current time zone to UTC for storage, and from UTC to the current time zone for retrieval.

The current time zone setting does not affect values displayed by functions such as UTC_TIMESTAMP() or values in DATE, TIME, or DATETIME columns. Nor are values in those data types stored in UTC; the time zone applies for them only when converting from TIMESTAMP values. If you want locale-specific arithmetic for DATE, TIME, or DATETIME values, convert them to UTC, perform the arithmetic, and then convert back.
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / MySQL [игнор отключен] [закрыт для гостей] / Time zone
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]