.oO(RichardODreamweaver)
>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 - ?)
Check date_default_timezone_set().
> 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.
You can only deal with your server's timezone setting.
> I have a sniffer script which detects the browsers language but I can't see
>that being of much use.
It's of absolutely no use. English and Spanish for example are spoken
all around the world, probably somewhere in almost every timezone.
> 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.
Possible. If UTC/GMT is not enough, you could let the users choose the
offset themselves. This is how it's done in many popular forum scripts.
>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,
YYYY-MM-DD
Works always. ;-)
> Or is there a way of formatting the MySQL data before its even called?
Of course you can also let MySQL return an already formatted date, which
is usually the preferred and most efficient way. Have a look at MySQL's
date and time functions, especially DATE_FORMAT().
Micha