Comments (14)
Good catch :) I assume you're saving the date and time as a timestamp ? I also believe your clients server is in a different timezone than they are in ?
Btw, if you're having a paying client, I wouldn't say no to a donation :)
from acf-field-date-time-picker.
Hi,
I am saving it as a timestamp.
I was able to find that the problem is in the fact that on initial save, it
thinks timezone is UTC. On subsequent, it knows that it's timezone is EST
(EDT right now) so +4hrs at the moment. I'll consider a donation if you are
able to fix this bug for us.
Thanks.
tz
On Tue, Sep 24, 2013 at 12:44 PM, Per Søderlind [email protected]:
Good catch :) I assume you're saving the date and time as a timestamp ? I
also believe your clients server is in a different timezone than they are
in ?Btw, if you're having a paying client, I wouldn't say no to a donationhttp://soderlind.no/donate/:)
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-25021641
.
from acf-field-date-time-picker.
Is the server in the same timezone as the client ? Reason I ask is that I suspect that PHP default timezone isn't the same as the customers. You can check this by checking phpinfo. Look for "Default timezone".
A quick fix would be to add date_default_timezone_set to the (child) theme functions.php
Try this (not tested .. yet):
date_default_timezone_set(get_option('timezone_string')); // get the timezone from Settings->General
from acf-field-date-time-picker.
Client is in the same timezone as me.
Trying what you just wrote.
Tz
On Tue, Sep 24, 2013 at 1:20 PM, Per Søderlind [email protected]:
Is the server in the same timezone as the client ? Reason I ask is that I
suspect that PHP default timezone isn't the same as the customers. You can
check this by checking phpinfohttp://php.net/manual/en/function.phpinfo.php.
Look for "Default timezone".A quick fix would be to add date_default_timezone_sethttp://php.net/manual/en/function.date-default-timezone-set.phpto the (child) theme functions.php
Try this (not tested .. yet):
date_default_timezone_set(get_option('timezone_string')); // get the timezone from Settings->General
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-25024539
.
from acf-field-date-time-picker.
and by the way in functions.php we have
date_default_timezone_set('America/New_York'), which is the correct time
zone.
The odd thing about this is that it only happens on initial save.
Subsequent saves retain the correct time so I'm reluctant to just add +5 to
the time because subsequent saves calculate the time correctly.
On Tue, Sep 24, 2013 at 1:24 PM, Tzvety Weiner [email protected]:
Client is in the same timezone as me.
Trying what you just wrote.
Tz
On Tue, Sep 24, 2013 at 1:20 PM, Per Søderlind [email protected]:
Is the server in the same timezone as the client ? Reason I ask is that I
suspect that PHP default timezone isn't the same as the customers. You can
check this by checking phpinfohttp://php.net/manual/en/function.phpinfo.php.
Look for "Default timezone".A quick fix would be to add date_default_timezone_sethttp://php.net/manual/en/function.date-default-timezone-set.phpto the (child) theme functions.php
Try this (not tested .. yet):
date_default_timezone_set(get_option('timezone_string')); // get the timezone from Settings->General
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-25024539
.
from acf-field-date-time-picker.
Nope, same result.
-4 offset on initial save.
tz
On Tue, Sep 24, 2013 at 1:26 PM, Tzvety Weiner [email protected]:
and by the way in functions.php we have
date_default_timezone_set('America/New_York'), which is the correct time
zone.The odd thing about this is that it only happens on initial save.
Subsequent saves retain the correct time so I'm reluctant to just add +5 to
the time because subsequent saves calculate the time correctly.On Tue, Sep 24, 2013 at 1:24 PM, Tzvety Weiner [email protected]:
Client is in the same timezone as me.
Trying what you just wrote.
Tz
On Tue, Sep 24, 2013 at 1:20 PM, Per Søderlind [email protected]:
Is the server in the same timezone as the client ? Reason I ask is that
I suspect that PHP default timezone isn't the same as the customers. You
can check this by checking phpinfohttp://php.net/manual/en/function.phpinfo.php.
Look for "Default timezone".A quick fix would be to add date_default_timezone_sethttp://php.net/manual/en/function.date-default-timezone-set.phpto the (child) theme functions.php
Try this (not tested .. yet):
date_default_timezone_set(get_option('timezone_string')); // get the timezone from Settings->General
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-25024539
.
from acf-field-date-time-picker.
Ok. Back to the drawing board (i.e. I'll have to do some testing). I'll get back to you.
from acf-field-date-time-picker.
hmm .. what's the date time format string you are using ? I'm tryng to replicate your problem but it works fine on my server.
from acf-field-date-time-picker.
.. and it's in the post where you set the date and time that you're getting the wrong time when you're saving the post (the first time) ?
from acf-field-date-time-picker.
When I'm looking at the post edit screen i see the following:
yy-mm-dd hh:mm tt
After I select from the popup and the slider, I get
2013-09-26 01:00 pm
On Tue, Sep 24, 2013 at 1:46 PM, Per Søderlind [email protected]:
.. and it's in the post where you set the date and time that you're
getting the wrong time when you're saving the post (the first time) ?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-25026725
.
from acf-field-date-time-picker.
This maybe of some use.
In update_value if I do
var_dump (date_default_timezone_get());
as the first line in the method, I get UTC (when it should be America/New
York) on initial save. After that it knows that it's America/New York.
I disabled all my plugins to make sure something wasn't getting set in one
of them. No difference.
On Tue, Sep 24, 2013 at 1:56 PM, Tzvety Weiner [email protected]:
When I'm looking at the post edit screen i see the following:
yy-mm-dd hh:mm tt
After I select from the popup and the slider, I get
2013-09-26 01:00 pm
On Tue, Sep 24, 2013 at 1:46 PM, Per Søderlind [email protected]:
.. and it's in the post where you set the date and time that you're
getting the wrong time when you're saving the post (the first time) ?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-25026725
.
from acf-field-date-time-picker.
According to this comment, timezone should be UTC. Try to comment out date_default_timezone_set('America/New_York');
in your functions.php
from acf-field-date-time-picker.
That did it!
Thanks a bunch. I'll put in a good word with my supervisors.
On Tue, Sep 24, 2013 at 2:13 PM, Per Søderlind [email protected]:
According to this commenthttp://www.php.net/manual/en/function.strtotime.php#106442,
timezone should be UTC. Try to comment out
date_default_timezone_set('America/New_York');in your functions.php—
Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-25029022
.
from acf-field-date-time-picker.
Excellent, glad I could help :)
from acf-field-date-time-picker.
Related Issues (20)
- Date only request HOT 1
- readonly Setting is Missing.
- After acf Update class acf_field_date_time_picker is declared more than once HOT 15
- Cannot save a time output that does not show a date HOT 1
- EOL ACF PRO 5.0 support (?) HOT 2
- Re-adding support for ACF PRO HOT 4
- Limit timespan
- Setting a default time using the time only option in ACF HOT 4
- "English (Canada)" WordPress Regional Setting Interpreted as Catala
- Php error (uncaught error calling undefined function) HOT 1
- UI time picker doesn't run? HOT 2
- Save and Get in ISO 8601 Format HOT 1
- Feature request: Bind the "Now" button to the site's timezone setting
- Is this maintained?
- Can't include in plugin HOT 3
- Can't order posts correctly, because saving as timestamp doesn't work!
- Year and month reversed using timestamps HOT 1
- Saving as timestamp doesn't work HOT 2
- Time Picker doesn't show on Front End HOT 1
- How i call the picker in other admin inputs? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acf-field-date-time-picker.