Giter Site home page Giter Site logo

Comments (14)

soderlind avatar soderlind commented on August 27, 2024

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.

tzweiner avatar tzweiner commented on August 27, 2024

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.

soderlind avatar soderlind commented on August 27, 2024

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.

tzweiner avatar tzweiner commented on August 27, 2024

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.

tzweiner avatar tzweiner commented on August 27, 2024

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.

tzweiner avatar tzweiner commented on August 27, 2024

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.

soderlind avatar soderlind commented on August 27, 2024

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.

soderlind avatar soderlind commented on August 27, 2024

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.

soderlind avatar soderlind commented on August 27, 2024

.. 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.

tzweiner avatar tzweiner commented on August 27, 2024

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.

tzweiner avatar tzweiner commented on August 27, 2024

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.

soderlind avatar soderlind commented on August 27, 2024

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.

tzweiner avatar tzweiner commented on August 27, 2024

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.

soderlind avatar soderlind commented on August 27, 2024

Excellent, glad I could help :)

from acf-field-date-time-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.