Halaman

Jumat, 18 November 2011

convert to gmt

. Jumat, 18 November 2011 .

==================================
DESCRIPTION:
==================================
This helper is an extension to the date_helper. It takes a supplied timestamp, a timezone value, and a daylight savings value as inputs and returns a the time in GMT. The timezone value should be formatted as UM8, etc. as described in the date helper documentation.
The reason for this addition to the date helper was that I was having some frustrations when trying to create a scheduling function. I needed to allow users to input a time which would be converted into GMT before being input into the db. This way, when another user in a different timezone viewed the scheduled event (stored in GMT), it could be easily converted into their local time using the existing gmt_to_local() function.
I thought that the local_to_gmt() function would work like the gmt_to_local() function but it turns out that it doesn’t for some reason. The local_to_gmt() function takes a given time, and converts to GMT based on the server’s timezone, not a given timezone.
This addition to the Date helper is simply the exact opposite of gmt_to_local().

http://codeigniter.com/wiki/convert_to_gmt

0 komentar:

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Posting Komentar

 
{nama-blog-anda} is proudly powered by Blogger.com | Template by Agus Ramadhani | o-om.com