[wp-hackers] Re: Sqlite

Terrence Wood tdw at funkive.com
Fri Jun 24 19:11:51 GMT 2005


Why not just store the UTC timestamp and set the TZ in the php 
environment? Timezones can be looked up and putinto a <select>, and 
involve no calculation on the users part.

// config blog
putenv('TZ='.get_settings('timezone'));

// get date
date($date_format,$post_date);

// store date
gmtdate($post_date);


regards
Terrence Wood.

On 25 Jun 2005, at 6:21 AM, Jeff Minard wrote:

> Robert Deaton wrote:
>> Storing just a unix timestamp and the offset means more parsing every
>> time dates need to be seen, instead of just once and throwing it into
>> the database.
>
> So instead of:
>
> 	date($blog_date_format, $post_date)
>
> you'd do:
>
> 	date($blog_date_format, $unix_timestamp_post_date + 
> $gmt_offset_converted_to_seconds_difference)
>
> Doesn't seem like a far strech to me.
>
> Jeff



More information about the wp-hackers mailing list