|
Hello, I'm thinking about to store dates on user login in my site, but I don't know what is the most logical solution.
Initially, I though to use server timezone, and then to manage it using difference operations between server machine date and user machine...
Started by Vittorio Vittori on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
UTC's definition is unlikely to undergoI'd recommend using server ....
timezone may be tempting, DST rules may change on very short notice (see: Argentina DST 2009 cases, the timezone itself may change (see Time in Indiana ).
|
|
The code for the date and time function:
function date_and_time($format,$timestamp) { $date_and_time = date($format,$timestamp); return $date_and_time; }
And then the code to display it:
<?php echo date_and_time("dS F Y", strtotime($profile[last_activity...
Started by Ryan on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Try this:
date_default_timezone_set('America/New_York');
You can change the timezone as appropriate_timezone_set('Europe/London');
Not sure if this what you're looking for, but try DateTime
date_default_timezone_set....
|
|
I run a server with some PHP-powered forums ( Vanilla 1.1.5a) on it, and I've recently noticed posts going out of order on them. Some digging revealed that Apache seems to be changing the current timezone back and forth from +0000 to -0500 on a request...
Started by Thomas Mayfield on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at serverfault):
Probably $TZ and is discussed in:
http://code.google.com/....
This is because functions change their return values (this is neither PHP- or Apache-specific).
In Unix/Linux each process can operate in a different timezone.
To workaround it.
|
Ask your Facebook Friends
|
Using this function:
perl -e 'use Time::Local; print timelocal("00","00","00","01","01","2000"),"\n";'
It will return an epochtime - but only in GMT - if i want the result in GMT+1 (which is the systems localtime(TZ)), what do i need to change?
Thanks...
Started by Anders on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Use strict; use DateTime; use DateTime....
Try:
env TZ=UTC+1 perl -e 'use Time::Local; print timelocal("00;now; print $dt->epoch, "\n";
For the timezones, you can use the DateTime::TimeZone module.
You just need to set the timezone.
|
|
I have a small app where the user is allowed to change their timezone. I have set the default timezone in the ini file but will need to change this on the fly so that I can pass the user defined time into a database query to get the proper results. What...
Started by jim on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Set the timezone for the MySQL=$userTimezone ;"
Store a date-time....
The string $userTimezone = 'America/Los_Angeles').
Is that too easy?
Here's one pattern:
Store Timezone per user (e.g.
Yes, use date_default_timezone_set as needed.
|
|
I have a few places in the code where I need to use the TimeZone. I can get the timezone name using DateTime::TimeZone . Is it reasonable to put the timezone name in a constant? Or should it be in a variable?
Started by Tom Feiner on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The user can changeIf the value can change, use a variable, of it is guaranteed to stay the same, use a constant the timezone and it would be nice....
For a timezone, the chance it will change is not big, but it is also not 0.
|
|
I travel for work routinely and am often in a different time zone than my home timezone for days at a time. Is there a drawback to routinely changing the timezone of my Vista PC back and forth each week as I travel? Btw, it's normally only one or two ...
Started by Lyndal on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at superuser):
This is why there is no easy way to change time on a domain.
Happens when changing the actual time.
|
|
I have an application that stores GMT time data in a MySQL db like this: 2009-12-16 15:27:47.
The user's timezone offset is stored in another column like this: -6
The above timezone is GMT-6, which is CST. Is there any way I can echo CST (i.e. - date(...
Started by Josh on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
, there isn't....
This may cause problems for a subset of your users, but it allows them to change their timezone if they need to.
Finally, change your application to display/save timezone identifiers instead of GMT offsets.
|
|
I'm using a VPS running Virtuozzo Containers with Parallels. Every time I reboot it sets the server's TimeZone to GMT+01 Amsterdam. If I change that to GMT+00 London and then reboot, it gets set back to Amsterdam again. Is there any way I can prevent ...
Started by GenericTypeTea on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at serverfault):
What version of Virtuozzo are you running.
Back to the underlying host's timezone setting.
|
|
This would be useful when I have a user's address or zipcode, and used that to find their timezone so they don't have to enter it in a separate field.
Started by Jerry Cheung on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
It will change, but probably....
To the user the question:
"What is your zip code" isn't likely to change very often.
I would recommend against trying to deduce the timezone from the users zip code.
Mention ESRI as a source of information.
|