View Single Post
  #1 (permalink)  
Old 06-12-2008, 01:32 PM
RichardODreamweaver
 
Posts: n/a
Diggs:
Default Date formatting according to UTC timezones

Using MySQL, php

http://www.freecrm.x10hosting.com

Before setting up my tables, I need to better understand the relevance of the
datetime and conversion of this field.

I am based in th UK (UTC, Greenwich mean time), but my host is in the states,
which means that the "now" date and time is based on US time (UTC - ?)

I have done formatting of the date i.e. <?php echo date('D,
d/m/Y',strtotime($datetime['DATETIME'])); ?> but am not sure how to approach
the problem relative to the timezone of any visitor in the world.

I have a sniffer script which detects the browsers language but I can't see
that being of much use.

The site does require a register/login so I suppose I could have a UTC
preference (i.e. UTC + 3 or whatever) set into their record. This could then
be used something like this.

<?php echo date('D,
d/m/Y',strtotime($datetime['DATETIME']+$row_recordsetuser['UTCTIMEZONEPREFERENCE
']));?>

Does this make sense?

I know the formatting is going to be a challenge as well because the US uses
m/d/Y,

Or is there a way of formatting the MySQL data before its even called?



Reply With Quote
Sponsored Links