![]() ![]() Timezone information will be in the database not depends on the system or code.You can specify the timezone that you want to get the correct time range of the data.So the timezone it will depends on your system or your code. ![]() The data storage will just 14:31:00 and not include timezone information. So when your save the timestampTz format data, 14:31:00+08:00, to timestamp format. The timezone date will be decided by your system or your code. The timestamp format will not include timezone information. $CarbonTime -> setTimezone ( 'GMT+0' ) Transform timestamp format to timestampTz But it will go wrong when I change my system time from UTC to Asia/Taipei. The official documentation told us to use setTimezone('UTC') or utc() to transform time to UTC format. $TimeEndAtCarbon -> getTimezone () -> toOffsetTimeZone () // select * from "timezone_test" where "time_at_timezone" >= ' 14:31:00+08:00' and "time_at_timezone" =', $time_start_at_timezone ) -> where ( 'time_at_timezone', ' get () Using Carbon to transform your timezone $time_end_at_timezone = $TimeEndAtCarbon -> toDateTimeString (). $time_start_at_timezone = $TimeStartAtCarbon -> toDateTimeString (). $TimeStartAtCarbon = Carbon :: parse ( $time_start_at ) $TimeEndAtCarbon = Carbon :: parse ( $time_end_at ) // Setting time with timezone ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |