As our application requirement, we have a date-time value in GMT that loaded from database, and we want to convert it to value in a specific time zone (example: America/Chicago).
Discussion posts and replies are publicly visible
Whereas the gmt() function converts a given date into its GMT equivalent, I think you might be interested more in local(), which does essentially the opposite.
The local function could also be used. However, the gmt function is a date and time subtraction function: The function converts its second parameter, the timezone offset in minutes, to an interval, and subtracts it from the first parameter, the base date and time.
I'm a little unclear on how that helps in this use case, though - it sounds like the original poster is starting with a GMT database value and wants to show it translated to a named time zone -- the description of the functionality of gmt() sounds like it inherently does the opposite of that.
Yes, Mike. You are right. I want a opposite of gmt().
I can't use the local() because I want to convert to a named timezone, not the timezone in user setting.
local() accepts a time zone parameter, though. Is this not working for you?