Hi all,
This might be a too bigger ask, but before I outsource it, I would like to try to understand it first, and do it for myself.
I am working on a project that involves an existing database. I am building the site around the existing data, but have run into issues with timestamps. Basically, I am hoping someone can give me a snippet example of what I would need(function, or class) to achieve this:
- Each user in the database has tables of data which includes content like blogs, articles, and other input containing timestamps for dates.
- Each user also has a timezone code(i.e: 10+, 12-, 1+, and so on and so forth) which they manually selected upon signup, to make any timestamps applicable to their timezone.
- I need to create a function(or class) that enables me to collect the users timezone, and convert any timestamps to be applicable to the users timezone code.
Example:
$timestamp = $rows[blogentry_date]; //Just an example of a query result
$users_timeszone_code = TheFunctionI_NeedHelpCreating() // Hopefully collects users
// timezone code, and converts it to a supported
// timezone using date_default_timezone_set()??(just a guess)
CreateDate($users_timeszone_code, $timestamp);
Example Output:
12, Monday 2007. 5:00am // Just as an example
Does this make sense? I hope my examples haven't made things worst, but i find it easier explaining what im thinking in little code snippets than with words..lol. Any help will be greatly appreciated.
Cheers, and thanks.