Digital Watch in Cakephp - cakephp

I want to use Digital watch in cakephp according to time zone I provide.
I'm able to show current time according to user timezone.
In details..
I'm working on a project. I have a table in database where I have seved users details like.
First Name
Last Name
Timezone
and other details.
I want to show the digital clock on user's profile according to timezone stored in the database.
Kindly help me how can I do that.
Thanks

You ned to use Javascript to display clock at page. You can use any of it, just goole and select clock you like. For example this from w3schools it will display clock in the user's current timezone.
If you still want to show clock in predefined timezone just set starting values from PHP instead this line from above example:
var today=new Date();
use something like
var today=new Date(<?=$current_timestamp_in_selected_timezone?>);
Use PHP function to build $current_timestamp_in_selected_timezone mktime() or date()
Note that you need to write javascript code inside your View to use such technic what isn't a good approach. In good application you need to write code of your JS clock in JS file, put it into app/webroot/js, include that file in layout or call inside controller and than pass variable from PHP. How to do that read here: How to pass variables and data from PHP to JavaScript?

Related

react big calendar display timezone

I want to display the time zone in the calendar edge, it will be like that:
GMT+x, do you have any idea if that's possible?
thank you
First, you would want the latest (0.36.0) version of RBC, which includes timezone support when using the momentLocalizer of the new luxonLocalizer. Second, you cannot currently override the internal TimeGutter component. You would have to replicate all of the views that use TimeGrid and copy over code to write that in yourself.

angular translate, how to get all the translate of one specific word in controller

I know that in controller I can use $translate.instant('HELLO_WORLD'), to get the translate to the 'current' set language.
What if the current is french, and I want to get english of 'HELLO_WORLD' too, but not changing the user's current preferred language.
The reason I want this is casue my app let user switch between french and english at any time. Everything works except for a directive that uses a $rootScope.object, the words inside doesnt get updated when user change the language.
The way Im trying to do it by is, I use a listener on this rootScope.object, when it get change, I manually change the item inside. However I need to know both french and english translate of each word to make the comparison and change.
The $translate.instant() API has a force language parameter. If you know your supported languages ahead of time you could query them all using separate calls to .instant().
instant(translationId, interpolateParams, interpolationId, forceLanguage, sanitizeStrategy)

Korean Equties: Saving Tick Data using Win32com.Dispatch.WithEvents. Is this possible? [Python]

Hello, I am currently using a Korean API feed that requires win32com.Dispatch.WithEvent method to subscribe to their tick data feed. (Win32com method was the sample they gave me).
This code works well when printing (time and price) of the tick data on the console. However, I want to save the timestamp and tickdata into a List and/or to a MySQL database.
Is there an alternative to implementing the aforementioned code without the use of Win32come.Dispatch.Withevent method?
Thank you so much in advance.

What parameters are required to create an "Add to Google Calendar" link?

We can use this link to add a new event to Google Calendar by parameters
https://www.google.com/calendar/render?
action=TEMPLATE&
text=EventName&
dates=20131206T050000Z/20131208T060000Z
&location=EventLocation&
sprop=name:Name&
sprop=website:EventWebite&
details=EventDetail&
sf=true&
output=xml
But I can't find any documentation about these parameters.
Does anyone know where's it?
Explanation about the available parameters:
anchor address:
http://www.google.com/calendar/event?
This is the base of the address before the parameters below.
action:
action=TEMPLATE
A default required parameter.
src:
Example: src=default%40gmail.com
Format: src=text
This is not covered by Google help but is an optional parameter
in order to add an event to a shared calendar rather than a user's default.
text:
Example: text=Garden%20Waste%20Collection
Format: text=text
This is a required parameter giving the event title.
dates:
Example: dates=20090621T063000Z/20090621T080000Z
(i.e. an event on 21 June 2009 from 7.30am to 9.0am
British Summer Time (=GMT+1)).
Format: dates=YYYYMMDDToHHMMSSZ/YYYYMMDDToHHMMSSZ
This required parameter gives the start and end dates and times
(in Greenwich Mean Time) for the event.
location:
Example: location=Home
Format: location=text
The obvious location field.
trp:
Example: trp=false
Format: trp=true/false
Show event as busy (true) or available (false)
sprop:
Example: sprop=http%3A%2F%2Fwww.me.org
Example: sprop=name:Home%20Page
Format: sprop=website and/or sprop=name:website_name
add:
Example: add=default%40gmail.com
Format: add=guest email addresses
details: (extra)
Example: details=Event%20multiline%0Adetails
Format: details=description text (google also accepts html in this text)
http://useroffline.blogspot.com/2009/06/making-google-calendar-link.html
The link from snoopy_15's answer points to an old Google URL that is currently being redirected to the new Google support page. This new page does not explain how to generate the kind of link asked in this question.
However, thanks to the wonders of Internet Archive: Wayback Machine, the older pages are still archived and available!
The latest available version is from March 2012, and it includes a form with a simple JavaScript code that still works! Sure, this is not an official documentation (and I'm still looking for one), and this is not even a documentation (it is an interactive form with a script), but it is the closest I could get.
These are the parameters that I use when I create these links. There are other parameters that exist, but I don't find them useful and they are optional. The details about how the dates work are particularly vexing and were never sufficiently documented by google.
action=TEMPLATE (required)
text (url encoded name of the event)
dates (ISO date format, startdate/enddate - must have both start and end time or it won't work. The start and end date can be the same if appropriate.)
to use the user's timezone: 20161208T160000/20161208T180000
to use global time, convert to UTC, then use 20131208T160000Z/20131208T180000Z
all day events, you can use 20161208/20161209 - note that the old google documentation gets it wrong. You must use the following date as the end date for a one day all day event, or +1 day to whatever you want the end date to be.
details (url encoded event description/details)
location (url encoded location of the event - make sure it's an address google maps can read easily)
You have one more param for specifying Guests
Add:
Example: add=default%40gmail.com
Format: add=guest email addresses
Demo
https://productforums.google.com/forum/#!topic/calendar/Ovj6BNTQNL0

How to set date to default time zone

I would like to set date to default time zone. At this moment my date looks like this: 2013-04-08T22:00:00 +02:00. I need to set my date to +00:00.
I tried to get the offset of my date and I received -120. Is it possible to set time offset? Are there maybe any better solutions?
Anybody an idea?
I'm using EXT JS.
JavaScript's Date object is bound to the time zone of the computer itself. There is no way to change the zone offset programmatically to an arbitrary value.
There is some work going on to add this functionality to the Moment.js library, but it is still in progress.
If you are just looking to get the time at UTC in ISO format, you can use .toISOString()
If you are speaking about code that is specific to the Ext.Date object from ExtJS, please edit your question and post some sample code so we can get a better idea of what you are talking about. Thanks.

Resources