TimeZone Download 1.2

This component/theme works with latest OSSN version.
German Arsalan Shah 4 months ago

Allow users to setup time zone for their profile. This timezone can be utilized later by components.

TimeZone OSSN component

Comments
gb Szsocial WebsiteHostingVPS Replied 6 days ago

Thanks for your work, using nearly all the components haha.

us Bansh33 - Replied 2 months ago

(just to be clear, this was about time ZONES, not the exact city a user may be located in. Z-Man's response is correct that it's not easy to determine that. If you prefer the UTC offset of your time ZONE rather than the city usually associated with that timezone as my example displays, that's easy enough to find also, just read the stackoverflow post I linked)

us Bansh33 - Replied 2 months ago

working jsfiddle showing a user's DEFAULT timezone as set in their browser in about 2 lines of code: jsfiddle.net/k12qL5xz

us Bansh33 - Replied 2 months ago

(in reference to my last post)

since Goodwin specifically asked why users should have to go through the stress of locating their correct time zone, you could do something like the following:

  • on user login, get the user's current timezone using the js code in my previous comment.
  • save timezone to database as user's mostrecenttimezone
  • display in profile

easy peasy. alternatively you can give the user option to update their current timezone in their profile settings. I really don't see what's so difficult about this.

us Bansh33 - Replied 2 months ago

Z-Man, it's perfectly possible to do with javascript (and not very difficult), even though not with PHP: https://stackoverflow.com/questions/6939685/get-client-time-zone-from-browser

javascript is used all over the place in OSSN, while it may be primarily PHP, it's certainly not exclusively written using PHP. I really don't see what's so difficult or prohibitive about:

const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
console.log(tz);

obviously its not going to be possible with a server side lang like php because timezone is set on the client side.

Hope that helps, Estee and Goodwin.

German ~Z~ Man Replied 2 months ago

@Godwin Dan
It's not possible to find out your exact location without using a 3rd party database. And all these service providers would allow only a limited number of requests per day/per month/etc. - otherwise they'll want you to pay.
Timezone 1.2 comes with a different solution which isn't that precise, but will lead you to the first city which is located in your own timezone.

ua Estee Andr Replied 3 months ago

Dear Sir, ~Z~ Man,

thank you for politeness and nice explaining. :)
Blessing to you!
I love Ossn very much, and this little unpleasant moment cannot change my good mind about your team as high and great professionals.

Respectfully and with friendly love,
Esther

ng Godwin Dan Replied 3 months ago

@Z Man, I was inquiring about setting the default time zone on my end. Sure enough they can't be a default timezone for everyone round the world.

German ~Z~ Man Replied 3 months ago

@Godwin
As Ossn is being used all around the world: What please should be the DEFAULT timezone?

ng Godwin Dan Replied 3 months ago

Hi. Is there a way to select a default time zone. Should users don't go through the stress of searching the correct time zone?

Component

Developer: Arsalan
License ossnv3
Type: User admin
Minimum Requirement: 5.0
Latest Version: 1.2
Last Updated 2 months ago
Repository Url View Repository

Versions