Is there a date time tag in KepserverEX 6? - plc

I am looking for a tag in KepServerEX 6 to get the current system date and time, these tags could be used for further usages such as PLC date time updates.
The time must be separated into simple HH and MM tags.
I have searched in the simulator and advanced simulator tags but nothing found.
Any help appreciated

Related

The analog of java.util.Calendar in Ionic

I need to do calculations like:
Given Unix time, tell the day of week.
Add given number of seconds to the known date, and get the new date.
Get the time (duration) difference between the two dates.
Ideally it should figure out for me the number of working days between the two Unix times but I understand that this may be too much.
When using Java, I would use java.util.Calendar for all these tasks. Which tools should be used in Ionic framework to get the same functionality? I tried to google "calendar ionic" but all results point to the Calendar GUI component that is not relevant for my task.

Change the hour when org-mode is starting new day

I use org-mode to clock my work and sometimes I work past midnight for few hours.
So, for example, I clocked time starting 03.06.2013 10pm and ending 04.06.2013 2am.
And org-mode is dividing it at 0am, starting new day. But it would be more convinient for me if that time 0am-2am was recorded for 03.06.2013 instead of 04.06.2013.
So I want to be able to specify at what time (say, 4am) org-mode is deciding the new day has started.
I can use a workaround by shifting timezone for the emacs process, but then I need to keep in mind that all recorded time is shifted... Not very convinient.
See the variable org-extend-today-until, a variable defined in org.el.
Documentation:
The hour when your day really ends. Must be an integer.
This has influence for the following applications:
When switching the agenda to "today". It it is still earlier than
the time given here, the day recognized as TODAY is actually yesterday.
When a date is read from the user and it is still before the time given
here, the current date and time will be assumed to be yesterday, 23:59.
Also, timestamps inserted in capture templates follow this rule.

Coldfusion: cfspreadsheet reading date incorrectly

Im using cfspreadsheet to read data from spreadsheets inside one of my applications. I've had a great deal of difficulty dealing with date columns. If I format the cell as date english (NZ) it displays right in the spreadsheet, but when I try to upload it switched the day and month. But If I change the format to a custom "dd/mm/yyyy" format it will upload without a problem.
Why would using the default date formats within the spreadsheet mess up the format when a custom one doesn't? Is there a work around?
I was using the Date Type "*14/03/2001".
The * means that it will:
respond to changes in regional date and time settings that are specified for the operating system.
So it must have been getting turned about by java or CF somewhere along the way. I changed it to the same date mask without the asterisk and the problem stopped occurring.

GWT Date Handing... have client respect server's timezone

I've read many a post here re: GWT date handling.
One in particular that struck a cord with me was this one
Sending a date and timezone from GAE server to GWT client
Anyhow, there's a need on a project I'm working on to be able to display days, hours, minute intervals as labels in a grid. My team has adopted an approach where all date/time instances are passed the client from the server in ISO8601 String format. The server time zone is to be respected by the client. The biz use case is that all date/time instances are in "market time", so that any browser that visits the app will see and work with dates in the "market time" timezone which happens to be GMT-05:00 (if Daylight Savings in effect) or GMT-06:00 (if Standard Time in effect).
I have posted some source on Github, here:
https://github.com/fastnsilver/gwt-datehandling-example
Particularly...
https://github.com/fastnsilver/gwt-datehandling-example/blob/master/src/main/java/me/fns/gwt/datehandling/client/util/CSTimeUtil.java
and the GWTTestCase
https://github.com/fastnsilver/gwt-datehandling-example/blob/master/src/test/java/me/fns/gwt/datehandling/client/util/CSTimeUtilTestGwt.java
in the hopes that someone can stare at the utility (and test) we're employing for date handling and help us see what we're not seeing.
EDIT
The basic problem is that CSTimeUtil#hoursInDay(Date) is not being calculated correctly in Production mode for "transition days" This method is used by other methods (like CSTimeUtil#dateToHour(Date) and CSTimeUtil#labelsForDay(Date)).
I have deployed our application with the current implementation of CSTimeUtil and it appears to work, but not quite. I'm really confused by alternate test results when e.g., mvn gwt:test is run in GWT Mode or Production Mode on Windows where the OS timezone is set to various timezones other than U.S. GMT-05:00 or GMT-06:00.
Based on some hints from Andrei and some serious blood, sweat and tears, I figured this out on my own. I have updated the code in Github, so if you're curious please go have a look there.
The basics:
Make sure all Strings are ISO8601 (no millis) compliant when sent from server to client and vice versa
Use DateTimeFormat.getFormat("yyyy-MM-ddTHH:mm:ss.SZZZZ") to format and parse dates
Retreive GMT-prefixed time zone info from java.util.Date in "Market time" using DateTimeFormat(Date, TimeZone), where TimeZone param is set as TimeZone.createTimeZone(TZ_CONSTANTS_INSTANCE.americaChicago()) and time zone String retrieved by TimeZone.getISOTimeZoneString(Date)
Generating days, see generateDay(Date, int) or hours generateHour(Date, int), from a source date had to take into consideration that an increment or decrement coudl trigger a change in time zone offset if occurring on a "transition day".
If you time zone is fixed, why would you use a string to represent date/time? You can send a standard Java Date object to the client. If you want, you can even store all dates and times as Longs and pass Longs only. You also send the GWT's TimeZone Json string for your time zone (once per session). You can find it in the GWT - there is a file with strings for all time zones.
On a client you use DateTimeFormat with many predefined formats to display whatever you need: full date, month and date, date and time, etc. Just remember to create TimeZone object from this Json string and use it in DateTimeFormat.getFormat(...).format(Date, TimeZone).
With this approach you don't have to worry about DST changes (they are encoded in that Json string) and locales. You only pass simple Date or Long objects.

Is this a bug in plist or Xcode?

G'day All
If you create a date item in the plist editor of Xcode or Apple's standalone plist editor you get something of the form <date>2010-05-29T10:30:00Z</date> which is a nice well formed ISO date at UTC (indicated by the "Z"). Because I'm in timezone UTC +10 when that's read into my app & then displayed I get 8:30 PM out, still good. However if that is a time in my timezone it should be <date>2010-05-29T10:30:00+10</date> (replacing "Z" with my timezone offset). All of my attempts at reading such dates into my iPhone app have had the plist rejected as if it is malformed & editing a plist with such a date in Apple's editors changed the "+10" to "Z" without adjusting the time.
Do others think I'm correct in thinking this is a bug in either plist or Xcode? My feeling is that the implementation of ISO date & time in plist is incomplete.
Cheers, Pedro :)
It's not a bug in either. In CoreFoundation (and Foundation), all dates are represented in Zulu time, which is why they are serialized that way. The date is then formatted for display based on the timezone of the device that wishes to display it. Although this is an ISO date string, the only valid time zone for CoreFoundation/Foundation is Zulu time.
If, for some reason, you need to track the time zone that any given date was generated in, you should track this as a separate property. If you need to write an XML property list from somewhere else, you must first convert the date to zulu and then write it out (although the documentation clearly specifies that these keys are for debugging aids/readability only and may change in the future). This makes plists a decent way to serialize data between two Cocoa/CoreFoundation applications, but a less suitable way of serializing data between a Cocoa/CoreFoundation app and some other application.