
Почему не изменяется время? ..она хранится в Datetime .. Timestamp исключен т.к. постоянно меняются данные
Цитата |
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. |
$mdata = ' 2012-12-31 00:01:00' ;
Цитата (timm2012 @ 8.01.2013 - 21:04) |
Это не полный скрипт. Данные будут постоянно меняться а время должно сохранится - поэтому datatime. |
Цитата (timm2012 @ 8.01.2013 - 21:04) |
как можно изменить часовой пояс в mdata допустим на +6 ? нужно учитывать что обычное прибавление на +6 не получится т.к. время может быть например 23:34 и это коснется не только времени но и даты |
SELECT (`mdata` + INTERVAL 6 HOUR) AS `local_time` FROM `table`