Coder Social home page Coder Social logo

Comments (2)

Xadoy avatar Xadoy commented on May 19, 2024

Also while reading the code for fresnsTimeByTimezone(), I am not sure I understand what we are trying to do here. If MySql returns string without timezone in fresnsDatabaseCurrentDateTime(), is this function working as expected?

from fresns.

jevantang avatar jevantang commented on May 19, 2024

Also while reading the code for fresnsTimeByTimezone(), I am not sure I understand what we are trying to do here. If MySql returns string without timezone in fresnsDatabaseCurrentDateTime(), is this function working as expected?

DateHelper::fresnsTimeByTimezone($time, $timezone);
https://fresns.org/supports/helpers/date.html#get-time-by-specified-timezone

For example
If $time is the time at 10:30 and the system timezone is +8, then 10:30 is the current time in the +8 timezone.
$timezone is the timezone you want to use, for example +2 timezone, then you will get 04:30 as a result.
This is so that people in different time zones will see the time value as the current time on their own clocks.

The fresnsDatabaseCurrentDateTime error affects this functionality.

Chinese Reply
比如 $time 是 10:30 时间,系统时区是 +8 时区,那么 10:30 则是当前 +8 时区的时间。
$timezone 是你想要使用的时区,比如 +2 时区,那么你将得到 04:30 这个结果。
这个功能是为了让不同时区的人,看到的时间值都是当前自己时钟的时间。

fresnsDatabaseCurrentDateTime() 报错会影响该功能。

from fresns.

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.