haoxingtng
Chief Gray
Joined: 25 Jan 2011
Posts: 629
Read: 0 topics
Warns: 0/5 Location: England
|
Posted: Fri 17:02, 25 Feb 2011 Post subject: ghd Display appointment and period as {regionperio |
|
|
}
$timezone='Asia/Calcutta'; // you want indian time zone
I am new in this article world.But i? have equitable start manuscript? articles almost my favorite field programming.
you tin simple obtain along this function.
we give data base query if you want time zone variables ($timezone)? comes from data base
convert_tz($date,$timezone,$format);
If? my artice is helpful for you amuse give me response aboard [link widoczny dla zalogowanych].
CREATE TABLE IF NOT EXISTS `pcp_timezone1` (
`timezid` int(11) NOT NULL auto_increment,
`tz` varchar(250) NOT NULL default '',
`gmt` text NOT NULL,
PRIMARY KEY? (`timezid`)
) ENGINE=InnoDB? DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;
--
-- Dumping data for table `pcp_timezone1`
--
INSERT INTO `pcp_timezone1` (`timezid`, `tz`, `gmt`) VALUES
(1, 'Pacific/Kwajalein', '(GMT -12:00) Eniwetok, Kwajalein'),
(2, 'Pacific/Samoa', '(GMT -11:00) Midway Island, Samoa'),
(3, 'Pacific/Honolulu', '(GMT -10:00) Hawaii'),
(4, 'America/Anchorage',[link widoczny dla zalogowanych], '(GMT -9:00) Alaska'),
(5, 'America/Los_Angeles', '(GMT -8:00) Pacific Time (US & Canada) Los Angeles,[link widoczny dla zalogowanych], Seattle'),
(6, 'America/Denver', '(GMT -7:00) Mountain Time (US & Canada) Denver'),
(7, 'America/Chicago', '(GMT -6:00) Central Time (US & Canada), Chicago, Mexico City'),
(8, 'America/New_York', '(GMT -5:00) Eastern Time (US & Canada), New York, Bogota, Lima'),
(9, 'Atlantic/Bermuda', '(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz'),
(10, 'Canada/Newfoundland', '(GMT -3:30) Newfoundland'),
(11, 'Brazil/East', '(GMT -3:00) Brazil, Buenos Aires, Georgetown'),
(12, 'Atlantic/Azores', '(GMT -2:00) Mid-Atlantic'),
(13, 'Atlantic/Cape_Verde', '(GMT -1:00 hour) Azores, Cape Verde Islands'),
(14, 'Europe/London', '(GMT) Western Europe Time, London,[link widoczny dla zalogowanych], Lisbon, Casablanca'),
(15, 'Europe/Brussels', '(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris'),
(16, 'Europe/Helsinki', '(GMT +2:00) Kaliningrad, South Africa'),
(17, 'Asia/Ba[link widoczny dla zalogowanych]ad', '(GMT +3:00) Ba[link widoczny dla zalogowanych]ad, Riyadh, Moscow, St. Petersburg'),
(18, 'Asia/Tehran', '(GMT +3:30) Tehran'),
(19, 'Asia/Baku', '(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi'),[link widoczny dla zalogowanych],
(20, 'Asia/Kabul', '(GMT +4:30) Kabul'),
(21, 'Asia/Karachi', '(GMT +5:00) Ekaterinburg, Islamabad,[link widoczny dla zalogowanych],[link widoczny dla zalogowanych], Karachi, Tashkent'),
(22, 'Asia/Calcutta', '(GMT +5:30) Bombay, Calcutta, Madras, New Delhi'),
(23, 'Asia/Dhaka', '(GMT +6:00) Almaty, Dhaka, Colombo'),
(24, 'Asia/Bangkok', '(GMT +7:00) Bangkok, Hanoi, Jakarta'),
(25, 'Asia/Hong_Kong', '(GMT +8:00) Beijing, Perth, Singapore, Hong Kong'),
(26, 'Asia/Tokyo', '(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk'),[link widoczny dla zalogowanych],
(27, 'Australia/Adelaide', '(GMT +9:30) Adelaide, Darwin'),
(28, 'Pacific/Guam', '(GMT +10:00) Eastern Australia, Guam, Vladivostok'),
(29, 'Asia/Magadan', '(GMT +11:00) Magadan, Solomon Islands, New Caledonia'),
(30, 'Pacific/Fiji', '(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka');
function convert_tz ($date_str, $tz, $date_format = "r") {
$time = strtotime($date_str);
$tz_bak = getenv("TZ");
putenv("TZ=$tz");
$ret = date($date_format, $time);
putenv("TZ" . ($tz_bak ? "=$tz_bak" : ""));
return $ret;
$format='F d,Y H:i a'? //? give format of date and time in which format you want time and date
This is cardinal function this ambition return? local time zone
$date='2009-06-29 11:02' // new data and time of server
If your server is in UK and your site is visiting from India . you ambition my site show date & time of ( Eg,[link widoczny dla zalogowanych], productions,uncomplicated site time,articles submitted date and time? ) in local time zone. without amending anyone object in? the data pedestal.
Display appointment and period as regional period region
Hello Reader
my favorite language is php. and i have amplified numerous simple for well as intricate projects in php.
So
I am? sharing some of my experience with you about time zone.
So come in the point.
Insert query in your file base
i understand my English is not so good . yet i all try apt enhance it.
if any problem to use please contact me by [link widoczny dla zalogowanych]
and
The post has been approved 0 times
|
|